From: Oleh Prypin Date: Thu, 9 Jun 2016 20:01:53 +0000 (+0300) Subject: Clarify the error when Python is missing on a remote host X-Git-Tag: 0.0.29~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2284e2a3b62d71b5cb535d69badad936ce782d13;p=remoto.git Clarify the error when Python is missing on a remote host Signed-off-by: Oleh Prypin --- diff --git a/remoto/connection.py b/remoto/connection.py index aba5d51..3d6851c 100644 --- a/remoto/connection.py +++ b/remoto/connection.py @@ -21,9 +21,16 @@ class Connection(object): self.interpreter = interpreter or 'python%s' % sys.version_info[0] if eager: - if detect_sudo: - self.sudo = self._detect_sudo() - self.gateway = self._make_gateway(hostname) + try: + if detect_sudo: + self.sudo = self._detect_sudo() + self.gateway = self._make_gateway(hostname) + except OSError: + self.logger.error( + "Can't communicate with remote host, possibly because " + "%s is not installed there" % self.interpreter + ) + raise def _make_gateway(self, hostname): gateway = execnet.makegateway(