[node-patches] Change in ovirt-node[master]: storage: Add validation to avoid check non exist variable

fabiand at redhat.com fabiand at redhat.com
Wed Sep 3 13:20:40 UTC 2014


Fabian Deutsch has posted comments on this change.

Change subject: storage: Add validation to avoid check non exist variable
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/31791/2/src/ovirtnode/storage.py
File src/ovirtnode/storage.py:

Line 1010: 
Line 1011: def storage_auto():
Line 1012:     storage = Storage()
Line 1013:     if "OVIRT_INIT" in _functions.OVIRT_VARS and \
Line 1014:             not _functions.OVIRT_VARS["OVIRT_INIT"] == "":
A bit denser to use is:

    if not _functions.OVIRT_VARS.get("OVIRT_INIT"):

get() will return None if the key (OVIRT_INIT) does not exist in the dict,
Line 1015:         #force root install variable for autoinstalls
Line 1016:         _functions.OVIRT_VARS["OVIRT_ROOT_INSTALL"] = "y"
Line 1017:         if _functions.check_existing_hostvg("") or \
Line 1018:            _functions.check_existing_hostvg("","AppVG"):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8afd0288eb1065daefeaca547d41d0312617c0b4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes



More information about the node-patches mailing list