[node-patches] Change in ovirt-node[master]: rhn_model: Add validation for vars

Code Review gerrit at ovirt.org
Fri Jan 13 22:24:43 UTC 2017


>From Douglas Schilling Landgraf <dougsland at redhat.com>:

Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: rhn_model: Add validation for vars
......................................................................

rhn_model: Add validation for vars

For support RHN autoinstall we need to increase the validation
of variables we use.

Change-Id: I5bd187d52e84ddcc1096f2d842884614106ff2d7
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1412619
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M src/ovirt/node/setup/rhn/rhn_model.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/03/70403/1

diff --git a/src/ovirt/node/setup/rhn/rhn_model.py b/src/ovirt/node/setup/rhn/rhn_model.py
index c0974d4..91e1c96 100755
--- a/src/ovirt/node/setup/rhn/rhn_model.py
+++ b/src/ovirt/node/setup/rhn/rhn_model.py
@@ -338,8 +338,9 @@
                     host, port, prefix = RHN().parse_host_uri(cfg["url"])
 
                     # Default to /rhsm for Satellite 6
-                    if DEFAULT_CA_SAT6 in cfg["ca_cert"] and \
-                       cfg["rhntype"] == "satellite":
+                    if cfg["ca_cert"] and \
+                            DEFAULT_CA_SAT6 in cfg["ca_cert"] and \
+                            cfg["rhntype"] == "satellite":
                         prefix = "/rhsm"
 
                 else:
@@ -357,7 +358,7 @@
                 # Figure out what other arguments need to be set
                 # If there's a ca certificate or it's satellite, it's sat6
                 if cfg["ca_cert"] and DEFAULT_CA_SAT6 in cfg["ca_cert"] and \
-                   cfg["rhntype"] == "satellite":
+                   cfg["rhntype"] and cfg["rhntype"] == "satellite":
                     mapping["--server.prefix"] = prefix
                 else:
                     prefix = "%s/%s" % (host, prefix) if prefix else \


-- 
To view, visit https://gerrit.ovirt.org/70403
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bd187d52e84ddcc1096f2d842884614106ff2d7
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