mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
mgr/crash: add 'crash ls-new'
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
7cbaa5ac56
commit
bebb1c3100
@ -37,7 +37,13 @@ Remove a specific crash dump.
|
||||
|
||||
ceph crash ls
|
||||
|
||||
List the timestamp/uuid crashids for all saved crash info.
|
||||
List the timestamp/uuid crashids for all new and archived crash info.
|
||||
|
||||
::
|
||||
|
||||
ceph crash ls-new
|
||||
|
||||
List the timestamp/uuid crashids for all newcrash info.
|
||||
|
||||
::
|
||||
|
||||
|
@ -107,10 +107,15 @@ class Module(MgrModule):
|
||||
self.crashes[crashid] = metadata
|
||||
key = 'crash/%s' % crashid
|
||||
self.set_store(key, json.dumps(metadata))
|
||||
self._refresh_health_checks()
|
||||
return 0, '', ''
|
||||
|
||||
def do_ls(self, cmd, inbuf):
|
||||
r = self.crashes.values()
|
||||
if cmd['prefix'] == 'crash ls':
|
||||
r = self.crashes.values()
|
||||
else:
|
||||
r = [crash for crashid, crash in self.crashes.items()
|
||||
if 'archived' not in crash]
|
||||
if cmd.get('format') == 'json' or cmd.get('format') == 'json-pretty':
|
||||
return 0, json.dumps(r, indent=4), ''
|
||||
else:
|
||||
@ -256,7 +261,13 @@ class Module(MgrModule):
|
||||
},
|
||||
{
|
||||
'cmd': 'crash ls',
|
||||
'desc': 'Show saved crash dumps',
|
||||
'desc': 'Show new and archived crash dumps',
|
||||
'perm': 'r',
|
||||
'handler': do_ls,
|
||||
},
|
||||
{
|
||||
'cmd': 'crash ls-new',
|
||||
'desc': 'Show new crash dumps',
|
||||
'perm': 'r',
|
||||
'handler': do_ls,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user