osmith submitted this change.

View Change

Approvals: pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
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(-)

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



To view, visit change 40970. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I138fda5f5807588428bba4eb1593b887fe7357c9
Gerrit-Change-Number: 40970
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>