[XS] Change in osmo-ttcn3-hacks[master]: testenv: clean: fix cleaning git dir
osmith has submitted this change. ( 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(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved 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: -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40025?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: I65da89581260fc60b3d8da0a93ee04c0c22c7f2c Gerrit-Change-Number: 40025 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
osmith