2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 03:37:47 +00:00

Fix some issues with service data

There were a couple of issues that are inadequately
explained and also a chance of failing during report
on the download.

Change-Id: Iac358f6f6b96925aa823d49fb94a320a99a90c23
This commit is contained in:
Jarrod Johnson 2019-12-03 11:04:53 -05:00
parent 6c1f7dd079
commit c469f22a2f

View File

@ -101,16 +101,18 @@ class TsmHandler(generic.OEMHandler):
progress({'phase': 'initializing', 'progress': float(percent)})
percent += 1
if status != 2:
raise Exception("Unknown error generating service data")
raise Exception("Unknown error generating service data: " + repr(check))
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:
currprog = self.wc.get_download_progress()
if currprog:
progress({'phase': 'download',
'progress': 100 * currprog})
if progress:
progress({'phase': 'complete'})
return savefile
@ -565,4 +567,4 @@ class TsmHandler(generic.OEMHandler):
images = wc.grab_json_response('/api/settings/media/remote/images')
self._exec_mount(filename, images, wc)
if not self.isipmi:
raise exc.BypassGenericBehavior()
raise exc.BypassGenericBehavior()