summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/status
diff options
context:
space:
mode:
authorPatrick Donnelly <pdonnell@redhat.com>2020-08-10 21:46:38 +0200
committerPatrick Donnelly <pdonnell@redhat.com>2020-08-10 21:46:38 +0200
commitaec63160669d3c891a7bfa0c8bfd7dfe690af0a3 (patch)
treebaa79d9078adfd071619a82c8bb75d318314f5eb /src/pybind/mgr/status
parentMerge pull request #36548 from votdev/fix_colors (diff)
parentmgr/mgr_module: metadata is fetched async (diff)
downloadceph-aec63160669d3c891a7bfa0c8bfd7dfe690af0a3.tar.xz
ceph-aec63160669d3c891a7bfa0c8bfd7dfe690af0a3.zip
Merge PR #35161 into master
* refs/pull/35161/head: mgr/mgr_module: metadata is fetched async mgr/status: metadata is fetched async Reviewed-by: Jan Fajerski <jfajerski@suse.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/pybind/mgr/status')
-rw-r--r--src/pybind/mgr/status/module.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/pybind/mgr/status/module.py b/src/pybind/mgr/status/module.py
index 89dde22f9e7..4cd8c2c714f 100644
--- a/src/pybind/mgr/status/module.py
+++ b/src/pybind/mgr/status/module.py
@@ -112,8 +112,10 @@ class Module(MgrModule):
if output_format not in ('json', 'json-pretty'):
activity = "Reqs: " + mgr_util.format_dimless(rate, 5) + "/s"
- metadata = self.get_metadata('mds', info['name'])
- mds_versions[metadata.get('ceph_version', "unknown")].append(info['name'])
+ defaults = defaultdict(lambda: None, {'version' : 'unknown'})
+ metadata = self.get_metadata('mds', info['name'], default=defaults)
+ mds_versions[metadata['ceph_version']].append(info['name'])
+
if output_format in ('json', 'json-pretty'):
json_output['mdsmap'].append({
'rank': rank,
@@ -159,8 +161,9 @@ class Module(MgrModule):
if output_format not in ('json', 'json-pretty'):
activity = "Evts: " + mgr_util.format_dimless(events, 5) + "/s"
- metadata = self.get_metadata('mds', daemon_info['name'])
- mds_versions[metadata.get('ceph_version', "unknown")].append(daemon_info['name'])
+ defaults = defaultdict(lambda: None, {'version' : 'unknown'})
+ metadata = self.get_metadata('mds', daemon_info['name'], default=defaults)
+ mds_versions[metadata['ceph_version']].append(daemon_info['name'])
if output_format in ('json', 'json-pretty'):
json_output['mdsmap'].append({
@@ -232,8 +235,9 @@ class Module(MgrModule):
standby_table.left_padding_width = 0
standby_table.right_padding_width = 2
for standby in fsmap['standbys']:
- metadata = self.get_metadata('mds', standby['name'])
- mds_versions[metadata.get('ceph_version', "unknown")].append(standby['name'])
+ defaults = defaultdict(lambda: None, {'version' : 'unknown'})
+ metadata = self.get_metadata('mds', standby['name'], default=defaults)
+ mds_versions[metadata['ceph_version']].append(standby['name'])
if output_format in ('json', 'json-pretty'):
json_output['mdsmap'].append({
@@ -323,7 +327,8 @@ class Module(MgrModule):
kb_avail = 0
if osd_id in osd_stats:
- metadata = self.get_metadata('osd', "%s" % osd_id)
+ defaults = defaultdict(lambda: None, {'hostname' : ''})
+ metadata = self.get_metadata('osd', str(osd_id), default=defaults)
stats = osd_stats[osd_id]
hostname = metadata['hostname']
kb_used = stats['kb_used'] * 1024