]> git-server-git.apps.pok.os.sepia.ceph.com Git - remoto.git/commitdiff
Clarify the error when Python is missing on a remote host
authorOleh Prypin <oleh@pryp.in>
Thu, 9 Jun 2016 20:01:53 +0000 (23:01 +0300)
committerOleh Prypin <oleh@pryp.in>
Thu, 9 Jun 2016 20:01:53 +0000 (23:01 +0300)
Signed-off-by: Oleh Prypin <oleh@pryp.in>
remoto/connection.py

index aba5d51bb84c35b655d446e7e9c1cdf0456387c2..3d6851c14bf4dc286c6cb6c672e606b65970e95e 100644 (file)
@@ -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(