From: Andrew Schoen Date: Tue, 9 Dec 2014 21:07:03 +0000 (-0600) Subject: respect --os-version and --os-type in teuthology.run. fixes #10279 X-Git-Tag: 1.1.0~1067^2~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F387%2Fhead;p=teuthology.git respect --os-version and --os-type in teuthology.run. fixes #10279 Signed-off-by: Andrew Schoen --- diff --git a/teuthology/run.py b/teuthology/run.py index aa5f58d1..e279ad04 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -254,6 +254,8 @@ def main(args): block = args["--block"] lock = args["--lock"] suite_path = args["--suite-path"] + os_type = args["--os-type"] + os_version = args["--os-version"] set_up_logging(verbose, archive) @@ -291,6 +293,14 @@ def main(args): # fetches the tasks and returns a new suite_path if needed config["suite_path"] = fetch_tasks_if_needed(config) + # overwrite the config value of os_type if --os-type is provided + if os_type: + config["os_type"] = os_type + + # overwrite the config value of os_version if --os-version is provided + if os_version: + config["os_version"] = os_version + # create a FakeNamespace instance that mimics the old argparse way of doing # things we do this so we can pass it to run_tasks without porting those # tasks to the new way of doing things right now diff --git a/teuthology/test/test_run.py b/teuthology/test/test_run.py index 82caad6d..cb1a9212 100644 --- a/teuthology/test/test_run.py +++ b/teuthology/test/test_run.py @@ -194,3 +194,5 @@ class TestRun(object): # ensures that values missing in args are added with the correct value assert fake_ctx["owner"] == "the_owner" assert fake_ctx["machine_type"] == "machine_type" + assert fake_ctx["config"]["os_version"] == "os_version" + assert fake_ctx["config"]["os_type"] == "os_type"