]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
install: poll for packages if wait-for-package: true
authorSage Weil <sage@inktank.com>
Wed, 27 Feb 2013 05:02:14 +0000 (21:02 -0800)
committerSage Weil <sage@inktank.com>
Wed, 27 Feb 2013 05:02:14 +0000 (21:02 -0800)
If the yaml has

 wait-for-package: true

then block and poll for the packages to appear if they are not already
there.  This is only useful for new branches or explicit sha1's, obviously.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/install.py

index c72519ffc1f6dbb22ea32b7cb8003657c243d277..3f818667b3a5365af70d4526c14ee90050450384 100644 (file)
@@ -81,7 +81,15 @@ def _update_deb_package_list_and_install(ctx, remote, debs, config):
                 'wget', '-q', '-O-', base_url + '/version',
                 ],
             stdout=StringIO(),
+            check_status=False,
             )
+        if r.exitstatus != 0:
+            if config.get('wait_for_package'):
+                log.info('Package not there yet, waiting...')
+                time.sleep(15)
+                continue
+            raise Exception('failed to fetch package version from %s' %
+                            base_url + '/version')
         version = r.stdout.getvalue().strip()
         log.info('Package version is %s', version)
         break