osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40970?usp=email )
Change subject: testenv: fix missing hasattr check ......................................................................
testenv: fix missing hasattr check
Fix that commands without a --distro argument ("./testenv.py init osmo-dev" and "./testenv.py clean") fail with:
AttributeError: 'Namespace' object has no attribute 'distro'
Fixes: 8d21add6 ("testenv: check for --distro without --podman") Change-Id: I138fda5f5807588428bba4eb1593b887fe7357c9 --- M _testenv/testenv/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py index 7a453a5..44e0e92 100644 --- a/_testenv/testenv/__init__.py +++ b/_testenv/testenv/__init__.py @@ -279,7 +279,7 @@ def set_args_defaults(): """Some defaults are set later, e.g. after verifying that --distro is not being used without --podman.""" - if args.distro is None: + if hasattr(args, "distro") and args.distro is None: args.distro = distro_default