Yaniv Bronhaim has posted comments on this change.

Change subject: tool: change configure verb logic.
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/34100/3/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:

Line 331: def _should_configure(c, args):
Line 332:     ret = True
Line 333:     configured = getattr(c, 'isconfigured', lambda: 
configurators.NO)()
Line 334:     configure_allowed = (configured != configurators.YES and
Line 335:                          (configured == configurators.NO or 
args.force))
more readable will be:
 configure_allowed = getattr(..isconfigured) != YES
 configure_allowed = configure_allowed and (configured == NO or args.force)
 configure_allowed = configure_allowed and getattr(c, 'validate', lambda: 
True)()

if not configure_allowed:
  raise ... (better to add the reason somehow and suggest the force flag)

return True
Line 336:     if getattr(c, 'validate', lambda: True)():
Line 337:         ret = configure_allowed
Line 338:     elif not configure_allowed:
Line 339:         raise configurators.InvalidConfig(


http://gerrit.ovirt.org/#/c/34100/3/tests/toolTests.py
File tests/toolTests.py:

Line 248:             'remove-config',
Line 249:         )
Line 250: 
Line 251:     def testConfigureFiltering(self):
Line 252:         class Thing(object):
call it dummy
Line 253:             pass
Line 254:         c, args = Thing(), Thing()
Line 255:         setattr(c, 'name', "Mock")
Line 256: 


-- 
To view, visit http://gerrit.ovirt.org/34100
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I166fbae855ebff93ef84270f11b74f32fcc115c2
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to