summaryrefslogtreecommitdiff
path: root/src/pybind/ceph_rest_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/ceph_rest_api.py')
-rwxr-xr-xsrc/pybind/ceph_rest_api.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pybind/ceph_rest_api.py b/src/pybind/ceph_rest_api.py
index fdfe84ee3cb..a379e352b1f 100755
--- a/src/pybind/ceph_rest_api.py
+++ b/src/pybind/ceph_rest_api.py
@@ -91,10 +91,13 @@ def load_conf(clustername='ceph', conffile=None):
raise EnvironmentError('No conf file found for "{0}"'.format(clustername))
def get_conf(cfg, clientname, key):
- try:
- return cfg.get(clientname, 'restapi_' + key)
- except ConfigParser.NoOptionError:
- return None
+ fullkey = 'restapi_' + key
+ for sectionname in clientname, 'client', 'global':
+ try:
+ return cfg.get(sectionname, fullkey)
+ except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
+ pass
+ return None
# XXX this is done globally, and cluster connection kept open; there
# are facilities to pass around global info to requests and to