osmith submitted this change.
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.