Antoni Segura Puimedon has posted comments on this change.
Change subject: Functional Tests [2/3]: Added ipwrapper.ruleExists+routeExists ......................................................................
Patch Set 2:
(3 comments)
.................................................... File lib/vdsm/ipwrapper.py Line 254: Line 255: def _validate(validator, entry): Line 256: try: Line 257: validator.fromText(entry) Line 258: except: What kind of exception are you likely or do you expect to get? This would catch even base exceptions. Line 259: return False Line 260: else: Line 261: return True Line 262:
Line 261: return True Line 262: Line 263: Line 264: def routeExists(route): Line 265: return route in [Route.fromText(entry) for entry in routeShowTable('all') I'd prefer this to be a generator than a list comprehension. Line 266: if _validate(Route, entry)] Line 267: Line 268: Line 269: def ruleList():
Line 283: _execCmd(command) Line 284: Line 285: Line 286: def ruleExists(rule): Line 287: return rule in [Rule.fromText(entry) for entry in ruleList() I'd prefer this to be a generator than a list comprehension.