Change in vdsm[ovirt-3.3]: hsm: fix isoprefix KeyError for inactive domains
fsimonce at redhat.com
fsimonce at redhat.com
Fri Oct 18 16:45:03 UTC 2013
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20300
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 at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20250
Reviewed-by: Dan Kenigsberg <danken at 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
--
To view, visit http://gerrit.ovirt.org/20300
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice78a4d652d495aff8672524fcd80b7306013928
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list