]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
config.py: remove get_file() use misc.get_file() instead
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 21 Mar 2013 15:38:52 +0000 (16:38 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 21 Mar 2013 15:38:52 +0000 (16:38 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph_deploy/config.py

index 6dba8b88172b487efef5f3875f9fffeabc7851d6..ae8aa48f52b52c5268d868e82d35373a3898f7b9 100644 (file)
@@ -4,6 +4,7 @@ from cStringIO import StringIO
 
 from . import exc
 from . import conf
+from . import misc
 from .cliutil import priority
 
 LOG = logging.getLogger(__name__)
@@ -36,16 +37,6 @@ def config_push(args):
         raise exc.GenericError('Failed to config %d hosts' % errors)
 
 
-def get_file(path):
-    """
-    Run on mon node, grab a file.
-    """
-    try:
-        with file(path, 'rb') as f:
-            return f.read()
-    except IOError:
-        pass
-
 def config_pull(args):
     import os.path
 
@@ -57,7 +48,7 @@ def config_pull(args):
         try:
             LOG.debug('Checking %s for %s', hostname, frompath)
             sudo = args.pushy('ssh+sudo:{hostname}'.format(hostname=hostname))
-            get_file_r = sudo.compile(get_file)
+            get_file_r = sudo.compile(misc.get_file)
             conf_file = get_file_r(path=frompath)
             if conf_file is not None:
                 LOG.debug('Got %s from %s', frompath, hostname)