From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXGYC-0003Kx-FQ for qemu-devel@nongnu.org; Wed, 12 Dec 2018 21:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXGYB-00022l-IF for qemu-devel@nongnu.org; Wed, 12 Dec 2018 21:16:32 -0500 References: <20181213015013.15350-1-jsnow@redhat.com> <20181213015013.15350-5-jsnow@redhat.com> From: Eric Blake Message-ID: Date: Wed, 12 Dec 2018 20:16:13 -0600 MIME-Version: 1.0 In-Reply-To: <20181213015013.15350-5-jsnow@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 4/7] iotests.py: don't abort if IMGKEYSECRET is undefined List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Max Reitz , Vladimir Sementsov-Ogievskiy , Markus Armbruster , Kevin Wolf On 12/12/18 7:50 PM, John Snow wrote: > 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 > --- > tests/qemu-iotests/iotests.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Eric Blake > 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' > > > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org