osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40945?usp=email )
Change subject: testenv: check for --distro without --podman
......................................................................
testenv: check for --distro without --podman
The --distro option only makes sense with --podman, complain if it is
used without --podman.
Change-Id: I1b7b26320c65d498a1e812f85f0b98eda95be783
---
M _testenv/testenv/__init__.py
1 file changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/40945/1
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 49f6368..3a92ff0 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -187,7 +187,7 @@
group.add_argument(
"-d",
"--distro",
- default=distro_default,
+ default=None, # override in set_args_defaults
help=f"distribution for podman (default: {distro_default})",
)
group.add_argument(
@@ -249,6 +249,9 @@
if args.binary_repo and not args.podman:
raise NoTraceException("--binary-repo requires --podman")
+ if args.distro and not args.podman:
+ raise NoTraceException("--distro requires --podman")
+
if args.kernel == "debian" and not args.podman:
raise NoTraceException("--kernel-debian requires --podman")
@@ -263,9 +266,17 @@
raise NoTraceException(f"testsuite dir not found: {testsuite_dir}")
+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:
+ args.distro = distro_default
+
+
def init_args():
parse_args()
verify_args_run()
+ set_args_defaults()
class ColorFormatter(logging.Formatter):
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40945?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1b7b26320c65d498a1e812f85f0b98eda95be783
Gerrit-Change-Number: 40945
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>