From: Alfredo Deza Date: Thu, 21 Aug 2014 19:05:53 +0000 (-0400) Subject: use args.ceph_conf if passed in X-Git-Tag: v1.5.12~6^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b046cd816b0f259a8080ba6e78c2e94f7f628db;p=ceph-deploy.git use args.ceph_conf if passed in Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/conf/ceph.py b/ceph_deploy/conf/ceph.py index 71da4fd..9042923 100644 --- a/ceph_deploy/conf/ceph.py +++ b/ceph_deploy/conf/ceph.py @@ -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()