From c0c33834cf7f55ec14021317a547393b8b9061f4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 26 Feb 2013 21:02:14 -0800 Subject: [PATCH] install: poll for packages if wait-for-package: true 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 --- teuthology/task/install.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/teuthology/task/install.py b/teuthology/task/install.py index c72519ffc1f6d..3f818667b3a53 100644 --- a/teuthology/task/install.py +++ b/teuthology/task/install.py @@ -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 -- 2.39.5