mirror of
https://opendev.org/x/pyghmi
synced 2025-01-27 19:37:44 +00:00
Implement diagnostic data for SR635/SR655
SR635/SR655 presents a distinct interface for getting support information bundle. Implement that interface. Change-Id: I38b2196b743a50f02702a6ffb3e538ddf0587984
This commit is contained in:
parent
68e45b919f
commit
2a40dd8cad
@ -643,6 +643,8 @@ class OEMHandler(generic.OEMHandler):
|
||||
return self.immhandler.get_diagnostic_data(savefile, progress, autosuffix)
|
||||
if self.is_fpc:
|
||||
return self.smmhandler.get_diagnostic_data(savefile, progress, autosuffix)
|
||||
if self.has_tsma:
|
||||
return self.tsmahandler.get_diagnostic_data(savefile, progress, autosuffix)
|
||||
|
||||
def get_oem_capping_enabled(self):
|
||||
if self.has_tsm:
|
||||
|
@ -118,7 +118,7 @@ class OEMHandler(object):
|
||||
:return:
|
||||
"""
|
||||
raise exc.UnsupportedFunctionality(
|
||||
'Do not know how to get diagnostic data for this platform')
|
||||
'Retrieving diagnostic data is not implemented for this platform')
|
||||
|
||||
def get_licenses(self):
|
||||
raise exc.UnsupportedFunctionality()
|
||||
|
@ -88,6 +88,33 @@ class TsmHandler(generic.OEMHandler):
|
||||
def get_uefi_configuration(self, hideadvanced=True):
|
||||
return self.fishclient.get_system_configuration(hideadvanced)
|
||||
|
||||
def get_diagnostic_data(self, savefile, progress=None, autosuffix=False):
|
||||
wc = self.wc
|
||||
wc.grab_json_response('/api/mini_ffdc', {'action': 'trigger'})
|
||||
status = 1
|
||||
percent = 0
|
||||
while status == 1:
|
||||
time.sleep(5)
|
||||
check = wc.grab_json_response('/api/mini_ffdc', {'action': 'check'})
|
||||
status = check.get('status', -1)
|
||||
if progress:
|
||||
progress({'phase': 'initializing', 'progress': float(percent)})
|
||||
percent += 1
|
||||
if status != 2:
|
||||
raise Exception("Unknown error generating service data")
|
||||
if autosuffix and not savefile.endswith('.tar'):
|
||||
savefile += '.tar'
|
||||
fd = webclient.FileDownloader(wc, '/api/mini_ffdc/package', savefile)
|
||||
fd.start()
|
||||
while fd.isAlive():
|
||||
fd.join(1)
|
||||
if progress and self.wc.get_download_progress():
|
||||
progress({'phase': 'download',
|
||||
'progress': 100 * self.wc.get_download_progress()})
|
||||
if progress:
|
||||
progress({'phase': 'complete'})
|
||||
return savefile
|
||||
|
||||
def init_redfish(self):
|
||||
self.fishclient = self.fish.Command(self.tsm, self.username, self.password,
|
||||
verifycallback=self._certverify)
|
||||
|
Loading…
x
Reference in New Issue
Block a user