From: Alfredo Deza Date: Thu, 12 Sep 2013 18:55:06 +0000 (-0400) Subject: create a connection helper for execnet X-Git-Tag: v1.2.4~7^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=abc2aebae8c180fae1c86d07d1e96cf6cb24333f;p=ceph-deploy.git create a connection helper for execnet Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/connection.py b/ceph_deploy/connection.py new file mode 100644 index 0000000..841826d --- /dev/null +++ b/ceph_deploy/connection.py @@ -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(), + )