diff options
author | Javier Jardón <jjardon@gnome.org> | 2015-03-19 14:31:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@baserock.org> | 2015-03-19 14:31:16 +0000 |
commit | 6c883efee015f03a4d65d68ec971d56c4d42760c (patch) | |
tree | 45681e130d10a216f6c8e78ae4569dca4abde16f | |
parent | 2fc8e2ad8c7a8b80eab680f96d24115d0ce27b19 (diff) | |
parent | aaef5cfe335ebbe742b7eb1593ec51bbeeb4dc7c (diff) | |
download | definitions-6c883efee015f03a4d65d68ec971d56c4d42760c.tar.gz |
Merge "deploy: Tighten SSH connectivity check"
-rw-r--r-- | writeexts.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/writeexts.py b/writeexts.py index 129b2bc4..aa185a2b 100644 --- a/writeexts.py +++ b/writeexts.py @@ -604,12 +604,16 @@ class WriteExtension(cliapp.Application): def check_ssh_connectivity(self, ssh_host): try: - cliapp.ssh_runcmd(ssh_host, ['true']) + output = cliapp.ssh_runcmd(ssh_host, ['echo', 'test']) except cliapp.AppException as e: logging.error("Error checking SSH connectivity: %s", str(e)) raise cliapp.AppException( 'Unable to SSH to %s: %s' % (ssh_host, e)) + if output.strip() != 'test': + raise cliapp.AppException( + 'Unexpected output from remote machine: %s' % output.strip()) + def is_device(self, location): try: st = os.stat(location) |