[node-patches] Change in ovirt-node[master]: Make EL7 register to SAM instead of RHN

rbarry at redhat.com rbarry at redhat.com
Tue Sep 16 15:33:36 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Make EL7 register to SAM instead of RHN
......................................................................

Make EL7 register to SAM instead of RHN

rhnreg is a no-go on EL7. Use subscription-manager instead. This
is a workaround until the RHN code can be redone and modularized.
Additionally, properly set RHN_TYPE if no selection has been
made and there's nothing pending in the model.

This does not resolve the bug since a product certificate is
needed for subscription-manager to return 0, but allows
registration

Change-Id: I73c05c154a21a68b1fd99889a05b3f5abd7d98d9
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1120558
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/rhn/rhn_model.py
M src/ovirt/node/setup/rhn/rhn_page.py
2 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/93/32993/1

diff --git a/src/ovirt/node/setup/rhn/rhn_model.py b/src/ovirt/node/setup/rhn/rhn_model.py
index c7289d4..f3e54f9 100644
--- a/src/ovirt/node/setup/rhn/rhn_model.py
+++ b/src/ovirt/node/setup/rhn/rhn_model.py
@@ -20,7 +20,7 @@
 # also available at http://www.gnu.org/copyleft/gpl.html.
 from ovirt.node import utils
 from ovirt.node.config.defaults import NodeConfigFileSection
-from ovirt.node.utils import process
+from ovirt.node.utils import process, system
 from ovirt.node.utils.fs import Config
 from urlparse import urlparse
 import sys
@@ -276,7 +276,7 @@
                 smconf.append(host)
                 smconf.append('--server.port')
                 smconf.append(port)
-                if not cacert.endswith(".pem"):
+                if cacert and not cacert.endswith(".pem"):
                     smconf.append('--server.prefix')
                     smconf.append(prefix)
                 else:
@@ -379,7 +379,9 @@
         cacert = cfg["ca_cert"]
         tx = utils.Transaction("Performing RHN Registration")
 
-        if rhntype == "sam" or cacert.endswith(".pem"):
+        if rhntype == "sam" or cacert and cacert.endswith(".pem"):
+            tx.append(ConfigureSAM())
+        elif system.is_min_el(7):
             tx.append(ConfigureSAM())
         else:
             tx.append(ConfigureRHNClassic())
diff --git a/src/ovirt/node/setup/rhn/rhn_page.py b/src/ovirt/node/setup/rhn/rhn_page.py
index c28f65f..a4d9ff2 100644
--- a/src/ovirt/node/setup/rhn/rhn_page.py
+++ b/src/ovirt/node/setup/rhn/rhn_page.py
@@ -254,7 +254,7 @@
             user = effective_model["rhn.username"]
             pw = effective_model["rhn.password"]
             profilename = effective_model["rhn.profilename"]
-            rhn_type = effective_model["rhn.type"]
+            rhn_type = effective_model["rhn.type"] or "rhn"
             url = effective_model["rhn.url"]
             ca = effective_model["rhn.ca"]
             org = effective_model["rhn.org"]


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73c05c154a21a68b1fd99889a05b3f5abd7d98d9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list