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

dougsland at redhat.com dougsland at redhat.com
Fri Aug 22 02:43:12 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

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

storage: Add validation to avoid check non exist variable

This patch adds a validation to check if "OVIRT_INIT" exists
in _functions.OVIRT_VARS before accessing it.

Change-Id: I8afd0288eb1065daefeaca547d41d0312617c0b4
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M src/ovirtnode/storage.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/91/31791/1

diff --git a/src/ovirtnode/storage.py b/src/ovirtnode/storage.py
index dceb539..297bb0b 100644
--- a/src/ovirtnode/storage.py
+++ b/src/ovirtnode/storage.py
@@ -1010,7 +1010,8 @@
 
 def storage_auto():
     storage = Storage()
-    if not _functions.OVIRT_VARS["OVIRT_INIT"] == "":
+    if "OVIRT_INIT" in _functions.OVIRT_VARS and \
+        not _functions.OVIRT_VARS["OVIRT_INIT"] == "":
         #force root install variable for autoinstalls
         _functions.OVIRT_VARS["OVIRT_ROOT_INSTALL"] = "y"
         if _functions.check_existing_hostvg("") or \


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8afd0288eb1065daefeaca547d41d0312617c0b4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>



More information about the node-patches mailing list