diff options
Diffstat (limited to 'morphlib/writeexts.py')
-rw-r--r-- | morphlib/writeexts.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py index bff21e8d..3f9c33d5 100644 --- a/morphlib/writeexts.py +++ b/morphlib/writeexts.py @@ -15,6 +15,7 @@ import cliapp +import logging import os import re import shutil @@ -417,3 +418,11 @@ class WriteExtension(cliapp.Application): else: raise cliapp.AppException('Unexpected value for %s: %s' % (variable, value)) + + def check_ssh_connectivity(self, ssh_host): + try: + cliapp.ssh_runcmd(ssh_host, ['true']) + 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)) |