Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: hsm: fix isoprefix KeyError for inactive domains ......................................................................
hsm: fix isoprefix KeyError for inactive domains
In a recent change f9cf58b (Make getRepoStats() a hsm method) a new regression was introduced that causes a KeyError on isoprefix for inactive domains.
In this patch: * fix the isoprefix KeyError for inactive domains * fix indentation for a related block of code
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1020543 Change-Id: Ice78a4d652d495aff8672524fcd80b7306013928 Signed-off-by: Federico Simoncelli fsimonce@redhat.com Reviewed-on: http://gerrit.ovirt.org/20250 Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/storage/hsm.py 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/20300/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index a432fe9..b38b0b0 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -2555,8 +2555,8 @@ domInfo = self._getDomsStats(pool.domainMonitor, doms) for sdUUID in doms.iterkeys(): if domInfo[sdUUID]['isoprefix']: - poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix'] - break + poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix'] + break else: poolInfo['isoprefix'] = '' # No ISO domain found
@@ -3583,7 +3583,8 @@
for sdUUID, sdStatus in doms.iteritems(): # Return statistics for active domains only - domInfo[sdUUID] = {'status': sdStatus, 'alerts': []} + domInfo[sdUUID] = {'status': sdStatus, 'alerts': [], + 'isoprefix': ''}
if sdStatus != sd.DOM_ACTIVE_STATUS or sdUUID not in repoStats: continue @@ -3615,9 +3616,8 @@ repoStats[sdUUID]['mdasize'], repoStats[sdUUID]['mdafree'])
- isoprefix = repoStats[sdUUID]['isoprefix'] - domInfo[sdUUID]['isoprefix'] = \ - isoprefix if isoprefix is not None else '' + if repoStats[sdUUID]['isoprefix'] is not None: + domInfo[sdUUID]['isoprefix'] = repoStats[sdUUID]['isoprefix']
return domInfo
Dan Kenigsberg has posted comments on this change.
Change subject: hsm: fix isoprefix KeyError for inactive domains ......................................................................
Patch Set 1: Code-Review+1
Federico Simoncelli has abandoned this change.
Change subject: hsm: fix isoprefix KeyError for inactive domains ......................................................................
Abandoned
vdsm-patches@lists.fedorahosted.org