Message ID | 20191001194715.2796-2-mreitz@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iotests: Honor $IMGOPTS in Python tests | expand |
On 10/1/19 3:46 PM, Max Reitz wrote: > We do not do anything with yet, but this is the first step. > > Signed-off-by: Max Reitz <mreitz@redhat.com> > --- > tests/qemu-iotests/iotests.py | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index 1c5fce3e9e..7030900807 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -69,6 +69,12 @@ output_dir = os.environ.get('OUTPUT_DIR', '.') > cachemode = os.environ.get('CACHEMODE') > qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE') > > +imgopts = os.environ.get('IMGOPTS', '') > +if len(imgopts) == 0: > + imgopts = [] > +else: > + imgopts = imgopts.split(',') > + Sometimes I think about the type of person I'd like to meet, and I ask myself if it's the type of person who would quote pep8, or say things like "idiomatic python" in a code review when the existing form has no technical problem whatsoever. I wonder what type of person I am. Well, questions for another day. > socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') > > luks_default_secret_object = 'secret,id=keysec0,data=' + \ > Reviewed-by: John Snow <jsnow@redhat.com>
02.10.2019 1:16, John Snow wrote: > > > On 10/1/19 3:46 PM, Max Reitz wrote: >> We do not do anything with yet, but this is the first step. >> >> Signed-off-by: Max Reitz <mreitz@redhat.com> >> --- >> tests/qemu-iotests/iotests.py | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py >> index 1c5fce3e9e..7030900807 100644 >> --- a/tests/qemu-iotests/iotests.py >> +++ b/tests/qemu-iotests/iotests.py >> @@ -69,6 +69,12 @@ output_dir = os.environ.get('OUTPUT_DIR', '.') >> cachemode = os.environ.get('CACHEMODE') >> qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE') >> >> +imgopts = os.environ.get('IMGOPTS', '') >> +if len(imgopts) == 0: >> + imgopts = [] >> +else: >> + imgopts = imgopts.split(',') >> + > > Sometimes I think about the type of person I'd like to meet, and I ask > myself if it's the type of person who would quote pep8, or say things > like "idiomatic python" in a code review when the existing form has no > technical problem whatsoever. > > I wonder what type of person I am. > > Well, questions for another day. Hope you don't say about quoting, as pep8 "does not make a recommendation for this". > >> socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') >> >> luks_default_secret_object = 'secret,id=keysec0,data=' + \ >> > > Reviewed-by: John Snow <jsnow@redhat.com> >
01.10.2019 22:46, Max Reitz wrote: > We do not do anything with yet, but this is the first step. > > Signed-off-by: Max Reitz <mreitz@redhat.com> > --- > tests/qemu-iotests/iotests.py | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index 1c5fce3e9e..7030900807 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -69,6 +69,12 @@ output_dir = os.environ.get('OUTPUT_DIR', '.') > cachemode = os.environ.get('CACHEMODE') > qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE') > > +imgopts = os.environ.get('IMGOPTS', '') > +if len(imgopts) == 0: > + imgopts = [] > +else: > + imgopts = imgopts.split(',') > + > socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') > > luks_default_secret_object = 'secret,id=keysec0,data=' + \ > Note, that empty sequences are always false, so you may use just "if not imgopts" Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1c5fce3e9e..7030900807 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -69,6 +69,12 @@ output_dir = os.environ.get('OUTPUT_DIR', '.') cachemode = os.environ.get('CACHEMODE') qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE') +imgopts = os.environ.get('IMGOPTS', '') +if len(imgopts) == 0: + imgopts = [] +else: + imgopts = imgopts.split(',') + socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') luks_default_secret_object = 'secret,id=keysec0,data=' + \
We do not do anything with yet, but this is the first step. Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/iotests.py | 6 ++++++ 1 file changed, 6 insertions(+)