From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaHDi-0008Mn-9w for qemu-devel@nongnu.org; Fri, 21 Dec 2018 04:35:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaHDh-000748-E4 for qemu-devel@nongnu.org; Fri, 21 Dec 2018 04:35:50 -0500 From: John Snow Date: Fri, 21 Dec 2018 04:35:23 -0500 Message-Id: <20181221093529.23855-6-jsnow@redhat.com> In-Reply-To: <20181221093529.23855-1-jsnow@redhat.com> References: <20181221093529.23855-1-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v6 05/11] iotests.py: don't abort if IMGKEYSECRET is undefined List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: eblake@redhat.com, Max Reitz , Fam Zheng , vsementsov@virtuozzo.com, John Snow , Kevin Wolf , Markus Armbruster Instead of using os.environ[], use .get with a default of empty string to match the setup in check to allow us to import the iotests module (for debugging, say) without needing a crafted environment just to import the module. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index d537538ba0..a34e66813a 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -63,7 +63,7 @@ socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') debug = False luks_default_secret_object = 'secret,id=keysec0,data=' + \ - os.environ['IMGKEYSECRET'] + os.environ.get('IMGKEYSECRET', '') luks_default_key_secret_opt = 'key-secret=keysec0' -- 2.17.2