summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2015-03-19 14:31:16 +0000
committerGerrit Code Review <gerrit@baserock.org>2015-03-19 14:31:16 +0000
commitcd33cecf4d993c7343351d345ec1a9f85c54e2ec (patch)
tree0615f0f38a518cd89267df9a605d03fa9a74709f
parent1d34c2a7825f0b964673d7719d4407d2b60cbe9d (diff)
parent5be813e9e1eab3ca289bac901dab40548bba42fe (diff)
downloadmorph-cd33cecf4d993c7343351d345ec1a9f85c54e2ec.tar.gz
Merge "deploy: Tighten SSH connectivity check"
-rw-r--r--morphlib/writeexts.py6
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)