From: Alfredo Deza Date: Wed, 16 Oct 2013 21:08:30 +0000 (-0400) Subject: allow to pass an (optional) username to the connection helper X-Git-Tag: v1.3~14^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef9c41548b3127db860a717e691611400948a2ea;p=ceph-deploy.git allow to pass an (optional) username to the connection helper Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py index 9b19c7b..7778bed 100644 --- a/ceph_deploy/hosts/__init__.py +++ b/ceph_deploy/hosts/__init__.py @@ -12,7 +12,7 @@ from ceph_deploy.connection import get_connection logger = logging.getLogger() -def get(hostname, fallback=None): +def get(hostname, username=None, fallback=None): """ Retrieve the module that matches the distribution of a ``hostname``. This function will connect to that host and retrieve the distribution @@ -29,7 +29,11 @@ def get(hostname, fallback=None): :param hostname: A hostname that is reachable/resolvable over the network :param fallback: Optional fallback to use if no supported distro is found """ - conn = get_connection(hostname, logger=logging.getLogger(hostname)) + conn = get_connection( + hostname, + username=username, + logger=logging.getLogger(hostname) + ) conn.import_module(remotes) distro_name, release, codename = conn.remote_module.platform_information() machine_type = conn.remote_module.machine_type()