Closed esunar closed 2 years ago
We can add the __bool__ function to the Result class as a fauture for use in a logic condition.
__bool__
def __bool__(self): return not self.empty
Than we can use it like this:
return result or Result(Severity.OK, 'Minimum juju version check passed.')
instead of this:
if result.empty: result.add_partial_result(Severity.OK, 'Minimum juju version check passed.') return result
Imported from Launchpad using lp2gh.
date created: 2021-07-21T09:13:38Z
owner: rgildein
assignee: rgildein
the launchpad url
(by rgildein) PR: https://github.com/canonical/juju-verify/pull/17
We can add the
__bool__
function to the Result class as a fauture for use in a logic condition.Than we can use it like this:
instead of this:
Imported from Launchpad using lp2gh.
date created: 2021-07-21T09:13:38Z
owner: rgildein
assignee: rgildein
the launchpad url