]> xenbits.xensource.com Git - openstack/ci-loop-config.git/commitdiff
nodepool/scripts: Synchronize with upstream
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 2 Nov 2016 12:24:21 +0000 (12:24 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Wed, 2 Nov 2016 17:54:21 +0000 (17:54 +0000)
nodepool/scripts/cache_devstack.py
nodepool/scripts/cache_git_repos.py
nodepool/scripts/prepare_node.sh
nodepool/scripts/prepare_tempest_testrepository.py

index 379d13aa06c67b268df2947bb820ffc7ec57081f..0c7505959ba072ea5a84d89754d3c2f3d0557acf 100755 (executable)
@@ -46,7 +46,7 @@ def tokenize(fn, tokens, distribution, comment=None):
         if 'qpid' in line:
             continue  # TODO: explain why this is here
         if comment and comment in line:
-            line = line[:line.rfind(comment)]
+            line = line[:line.find(comment)]
         line = line.strip()
         if line and line not in tokens:
             tokens.append(line)
@@ -59,7 +59,7 @@ def _legacy_find_images(basedir):
         line = line.strip()
         if line.startswith('IMAGE_URLS'):
             if '#' in line:
-                line = line[:line.rfind('#')]
+                line = line[:line.find('#')]
             if line.endswith(';;'):
                 line = line[:-2]
             line = line.split('=', 1)[1].strip()
index bea36c932e6029425068c8611cc3e014d65bb8c5..46b5758273f707546656a62bc0d7aa8f388f78a2 100755 (executable)
@@ -74,14 +74,18 @@ def main():
         # YAML module which is not in the stdlib.
         m = PROJECT_RE.match(line)
         if m:
-            (status, out) = clone_repo(m.group(1))
-            print out
-            if status != 0:
-                print 'Retrying to clone %s' % m.group(1)
-                (status, out) = clone_repo(m.group(1))
+            project = m.group(1)
+            dirname = os.path.dirname(project)
+            # Skip repos that are inactive
+            if not ('attic' in dirname or dirname == 'stackforge'):
+                (status, out) = clone_repo(project)
                 print out
                 if status != 0:
-                    raise Exception('Failed to clone %s' % m.group(1))
+                    print 'Retrying to clone %s' % m.group(1)
+                    (status, out) = clone_repo(m.group(1))
+                    print out
+                    if status != 0:
+                        raise Exception('Failed to clone %s' % m.group(1))
 
 
 if __name__ == '__main__':
index c039dcccd54f120ec4792d70d894b5ab6ce1d034..92718c9cc5a7409b1b8cfcd7ab730744f20e171a 100755 (executable)
@@ -232,7 +232,7 @@ sudo rm -fr /tmp/zuul
 # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588
 sudo -H virtualenv /usr/zuul-swift-logs-env
 sudo -H /usr/zuul-swift-logs-env/bin/pip install python-magic argparse \
-    requests glob2
+    requests glob2 requestsexceptions
 
 # Create a virtualenv for os-testr (which contains subunit2html)
 # this is in /usr instead of /usr/loca/ due to this bug on precise:
index 2947baf4923d78813169dbb4a1b2b9c9c2d6463a..a933b8575716be8876557379921d96f9f95686c1 100755 (executable)
@@ -37,14 +37,16 @@ def main():
     shell.parse_args([])
     shell.CONF.set_override('connection', DB_URI, group='database')
     session = api.get_session()
-    run_ids = api.get_recent_successful_runs(num_runs=10,
-                                             session=session)
+    runs = api.get_recent_successful_runs_by_run_metadata(
+        'build_name', 'gate-tempest-dsvm-neutron-full',
+        num_runs=10, session=session)
     session.close()
     preseed_path = os.path.join(TEMPEST_PATH, 'preseed-streams')
-    os.mkdir(preseed_path)
-    for run in run_ids:
-        with open(os.path.join(preseed_path, run + '.subunit'), 'w') as fd:
-            write_subunit.sql2subunit(run, fd)
+    if not os.path.isdir(preseed_path):
+        os.mkdir(preseed_path)
+    for run in runs:
+        with open(os.path.join(preseed_path, run.uuid + '.subunit'), 'w') as fd:
+            write_subunit.sql2subunit(run.uuid, fd)
 
 if __name__ == '__main__':
     main()