]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
allow to pass an (optional) username to the connection helper
authorAlfredo Deza <alfredo.deza@inktank.com>
Wed, 16 Oct 2013 21:08:30 +0000 (17:08 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 17 Oct 2013 18:38:57 +0000 (14:38 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/hosts/__init__.py

index 9b19c7b318894db97768cdeb0d55c0b9905c310e..7778bede919d7caab57b7eea20ef76f77e41ff54 100644 (file)
@@ -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()