Dan Kenigsberg has posted comments on this change.
Change subject: Related to BZ#704131 - Simplify getDomains.
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
....................................................
File vdsm/storage/sp.py
Line 1184: isActive = lambda v: True if not activeOnly else v ==
sd.DOM_ACTIVE_STATUS
As much as I love iterators and lambdas, I do not think the new code is simpler.
a function called isActive() returning True if not activeOnly, is a bad idea. Using opaque
(k, v) is confusing relative to (sdUUID, status).
Consider
return dict((sdUUID, status) for sdUUID, status in
self.getMetaParam(PMDK_DOMAINS).iteritems() if not activeOnly or isActive(sdUUID))
--
To view, visit
http://gerrit.usersys.redhat.com/762
To unsubscribe, visit
http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I332524d5e2a060ed11cb2d2b78235701080cb6fe
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo Warszawski <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>