From 4189625ac0ed5f04e9dc63bd5d603dd63782fa1b Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 2 Jul 2014 09:54:27 +0000 Subject: do-release: Check access to configured upload servers when script starts If the release script is expected to be 'push-button' then we can't assume the user will be paying attention to error messages later on. --- scripts/do-release.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/do-release.py b/scripts/do-release.py index ad34dc3e..5c4fff04 100644 --- a/scripts/do-release.py +++ b/scripts/do-release.py @@ -538,9 +538,23 @@ class Upload(object): cliapp.ssh_runcmd(server, ['rm', remote_artifacts_tar]) +def check_ssh_access(server): + status('Checking for access to server %s', server) + + try: + cliapp.ssh_runcmd(server, ['true']) + except cliapp.AppException as e: + logging.debug('Got exception: %s', e) + raise cliapp.AppException( + 'Couldn\'t connect to configured remote server %s' % server) + + def main(): logging.basicConfig(level=logging.INFO) + check_ssh_access(config.images_server) + check_ssh_access(config.artifacts_server) + deploy_images = DeployImages() outputs = deploy_images.run() -- cgit v1.2.1