osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40025?usp=email )
Change subject: testenv: clean: fix cleaning git dir ......................................................................
testenv: clean: fix cleaning git dir
Don't try to build a PATH that contains the testsuite dir if running the "clean" action, because then no testsuite is defined.
Fix for: $ ./testenv.py clean [testenv] + ['rm', '-rf', '/home/user/.cache/osmo-ttcn3-testenv/git'] Traceback (most recent call last): File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/./testenv.py", line 137, in <module> main() File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/./testenv.py", line 133, in main clean() File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/./testenv.py", line 117, in clean testenv.cmd.run(["rm", "-rf", path]) File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/_testenv/testenv/cmd.py", line 106, in run env=generate_env(env), ^^^^^^^^^^^^^^^^^ File "/home/user/code/osmo-dev/src/osmo-ttcn3-hacks/_testenv/testenv/cmd.py", line 72, in generate_env path += f":{os.path.join(testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite)}" ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Namespace' object has no attribute 'testsuite'
Change-Id: I65da89581260fc60b3d8da0a93ee04c0c22c7f2c --- M _testenv/testenv/cmd.py 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/25/40025/1
diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index df57b79..f84769d 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -68,7 +68,7 @@ ret = dict(env_extra) path = os.path.join(testenv.data_dir, "scripts") path += f":{os.path.join(testenv.data_dir, 'scripts/qemu')}" - if testenv.testsuite.ttcn3_hacks_dir: + if testenv.args.action == "run" and testenv.testsuite.ttcn3_hacks_dir: path += f":{os.path.join(testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite)}"
if usr_dir: