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

 

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40970?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

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 <osm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>

Reply via email to