]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
openstack: allow override of openstack:clone: 797/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 2 Dec 2015 14:06:26 +0000 (15:06 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 2 Mar 2016 09:59:42 +0000 (16:59 +0700)
When running from a wip teuthology branch, it is inconvenient to tweak
~/.teuthology.yaml. Add --teuthology-git-url and --teuthology-branch to
take precendence and override the defaults.

Signed-off-by: Loic Dachary <loic@dachary.org>
scripts/openstack.py
teuthology/openstack/__init__.py
teuthology/openstack/test/test_openstack.py

index 1f258b3c9466c69430dfb6c35ed886bb149af514..b467de4f508f16425971935cda11adf7d9bb2644 100644 (file)
@@ -61,6 +61,15 @@ and analyze results.
         action='store_true', default=None,
         help='destroy the cluster, if it exists',
     )
+    parser.add_argument(
+        '--teuthology-git-url',
+        help=("git clone url for teuthology"),
+    )
+    parser.add_argument(
+        '--teuthology-branch',
+        help="use this teuthology branch instead of master",
+        default='master',
+    )
     parser.add_argument(
         '--upload',
         action='store_true', default=False,
index b6942051266b93cbc209a0f32c41ce53ce8582fb..3746de24b5898ac15fe9233a671853049b3fe18e 100644 (file)
@@ -478,6 +478,8 @@ class TeuthologyOpenStack(OpenStack):
         argv = []
         while len(original_argv) > 0:
             if original_argv[0] in ('--name',
+                                    '--teuthology-branch',
+                                    '--teuthology-git-url',
                                     '--archive-upload',
                                     '--archive-upload-url',
                                     '--key-name',
@@ -646,6 +648,10 @@ ssh access           : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/
         else:
             upload = ''
         clone = teuth_config.openstack['clone']
+        if self.args.teuthology_git_url:
+            clone = ("git clone -b {branch} {url}".format(
+                branch=self.args.teuthology_branch,
+                url=self.args.teuthology_git_url))
         log.debug("OPENRC = " + openrc + " " +
                   "TEUTHOLOGY_USERNAME = " + self.username + " " +
                   "CLONE_OPENSTACK = " + clone + " " +
index 0317fc072519a8293b19c3684b23a9b60031cb5f..107103d0ec834635d99cbf558eba06b8cefd3cbd 100644 (file)
@@ -338,7 +338,9 @@ openstack keypair delete {key_name} || true
         ]
         archive_upload = 'user@archive:/tmp'
         argv = (self.options +
-                ['--upload',
+                ['--teuthology-git-url', 'TEUTHOLOGY_URL',
+                 '--teuthology-branch', 'TEUTHOLOGY_BRANCH',
+                 '--upload',
                  '--archive-upload', archive_upload] +
                 teuthology_argv)
         args = scripts.openstack.parse_args(argv)
@@ -358,7 +360,7 @@ openstack keypair delete {key_name} || true
         assert "nworkers=" + str(args.simultaneous_jobs) in l
         assert "username=" + teuthology.username in l
         assert "upload=--archive-upload user@archive:/tmp" in l
-        assert "clone=git clone" in l
+        assert "clone=git clone -b TEUTHOLOGY_BRANCH TEUTHOLOGY_URL" in l
         assert os.environ['OS_AUTH_URL'] in l
         assert " ".join(teuthology_argv) in l