]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
create a connection helper for execnet
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 12 Sep 2013 18:55:06 +0000 (14:55 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 12 Sep 2013 18:55:06 +0000 (14:55 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/connection.py [new file with mode: 0644]

diff --git a/ceph_deploy/connection.py b/ceph_deploy/connection.py
new file mode 100644 (file)
index 0000000..841826d
--- /dev/null
@@ -0,0 +1,14 @@
+from ceph_deploy.lib.remoto import Connection
+from sudo_pushy import needs_sudo  # TODO move this to utils once pushy is out
+
+
+def get_connection(hostname, logger):
+    """
+    A very simple helper, meant to return a connection
+    that will know about the need to use sudo.
+    """
+    return Connection(
+        hostname,
+        logger=logger,
+        sudo=needs_sudo(),
+    )