[node-patches] Change in ovirt-node[master]: Fix pep8 warnings
pzhukov at redhat.com
pzhukov at redhat.com
Thu Jan 28 11:35:10 UTC 2016
Pavel Zhukov has posted comments on this change.
Change subject: Fix pep8 warnings
......................................................................
Patch Set 6:
(1 comment)
https://gerrit.ovirt.org/#/c/52678/6/src/ovirtnode/ovirtfunctions.py
File src/ovirtnode/ovirtfunctions.py:
Line 276: # return 1 otherwise
Line 277:
Line 278:
Line 279: def is_upgrade():
Line 280: return OVIRT_VARS.get("OVIRT_UPGRADE") == "1"
> what happens if there's no such key in OVIRT_VARS? You don't test using has
get doesn't raise Exception It returns None if not has_key. So it should work
Pep8 was complained about has_key as deprecated it can be replaced with "in" but get is exactly for this usecase
Line 281:
Line 282:
Line 283: def is_install():
Line 284: return OVIRT_VARS.get("OVIRT_INSTALL") == "1"
--
To view, visit https://gerrit.ovirt.org/52678
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8c446035431ed8748e50a9f2d130d139ccac155c
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Pavel Zhukov <pzhukov at redhat.com>
Gerrit-Reviewer: Anton Marchukov <amarchuk at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Pavel Zhukov <pzhukov at redhat.com>
Gerrit-Reviewer: Yaniv Kaul <ykaul at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the node-patches
mailing list