From: Alfredo Deza Date: Thu, 7 Nov 2013 16:30:27 +0000 (-0500) Subject: allow to bypass the sudo detection in the connection obj X-Git-Tag: v1.3.2~10^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c656221c8ec79bf705797bd0045f7af38048bf68;p=ceph-deploy.git allow to bypass the sudo detection in the connection obj Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/connection.py b/ceph_deploy/connection.py index 3a49742..f43bf94 100644 --- a/ceph_deploy/connection.py +++ b/ceph_deploy/connection.py @@ -2,18 +2,20 @@ import getpass from ceph_deploy.lib.remoto import Connection -def get_connection(hostname, username, logger, threads=5): +def get_connection(hostname, username, logger, threads=5, use_sudo=None): """ A very simple helper, meant to return a connection that will know about the need to use sudo. """ + if use_sudo is None: + use_sudo = needs_sudo() if username: hostname = "%s@%s" % (username, hostname) try: conn = Connection( hostname, logger=logger, - sudo=needs_sudo(), + sudo=use_sudo, threads=threads, )