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 | cd33cecf4d993c7343351d345ec1a9f85c54e2ec (patch) | |
tree | 0615f0f38a518cd89267df9a605d03fa9a74709f /morphlib/writeexts.py | |
parent | 1d34c2a7825f0b964673d7719d4407d2b60cbe9d (diff) | |
parent | 5be813e9e1eab3ca289bac901dab40548bba42fe (diff) | |
download | morph-cd33cecf4d993c7343351d345ec1a9f85c54e2ec.tar.gz |
Merge "deploy: Tighten SSH connectivity check"
Diffstat (limited to 'morphlib/writeexts.py')
-rw-r--r-- | morphlib/writeexts.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index 129b2bc4..aa185a2b 100644 --- a/morphlib/writeexts.py +++ b/morphlib/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) |