]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
use args.ceph_conf if passed in
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 21 Aug 2014 19:05:53 +0000 (15:05 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 21 Aug 2014 19:05:53 +0000 (15:05 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/conf/ceph.py

index 71da4fdd64d1da67a6ad092b3b94c2f6a59c796a..90429232d43791c84d96f4ff0d5f5c7ec7523314 100644 (file)
@@ -42,7 +42,12 @@ def parse(fp):
 
 
 def load(args):
-    path = '{cluster}.conf'.format(cluster=args.cluster)
+    """
+    :param args: Will be used to infer the proper configuration name, or
+    if args.ceph_conf is passed in, that will take precedence
+    """
+    path = args.ceph_conf or '{cluster}.conf'.format(cluster=args.cluster)
+
     try:
         f = file(path)
     except IOError as e:
@@ -58,8 +63,11 @@ def load_raw(args):
     """
     Read the actual file *as is* without parsing/modifiying it
     so that it can be written maintaining its same properties.
+
+    :param args: Will be used to infer the proper configuration name
+    :paran path: alternatively, use a path for any configuration file loading
     """
-    path = '{cluster}.conf'.format(cluster=args.cluster)
+    path = args.ceph_conf or '{cluster}.conf'.format(cluster=args.cluster)
     try:
         with open(path) as ceph_conf:
             return ceph_conf.read()