[node-patches] Change in ovirt-node[ovirt-3.6]: rhn_model: truncate rhn_virtualization cronjob

dougsland at redhat.com dougsland at redhat.com
Fri Aug 26 13:45:06 UTC 2016


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: rhn_model: truncate rhn_virtualization cronjob
......................................................................

rhn_model: truncate rhn_virtualization cronjob

In case SAM rhn type is selected and registered, avoid conflict
with RHN classic.

Change-Id: I196033d42328d879b82454f8c0e801f0f6e86773
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1365696
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
(cherry picked from commit 08333a25c7d7ec08e8b60802302cdbe4a5e3fb52)
---
M src/ovirt/node/setup/rhn/rhn_model.py
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/74/62874/1

diff --git a/src/ovirt/node/setup/rhn/rhn_model.py b/src/ovirt/node/setup/rhn/rhn_model.py
index 797c2b9..7b0a4f9 100755
--- a/src/ovirt/node/setup/rhn/rhn_model.py
+++ b/src/ovirt/node/setup/rhn/rhn_model.py
@@ -318,6 +318,7 @@
                 if os.path.exists(cert_path):
                     Config().unpersist(cert_path)
                     os.unlink(cert_path)
+                Config().unpersist("/etc/cron.d/rhn-virtualization.cron")
 
         class ConfigureSubscriptionManager(utils.Transaction.Element):
             title = "Configuring subscription manager"
@@ -469,6 +470,12 @@
 
                 # If we made it down here, we registered successfully
                 else:
+                    # Truncate the classic rhn cron job in favor of RHSM
+                    rhn_cronjob = "/etc/cron.d/rhn-virtualization.cron"
+                    with open(rhn_cronjob, "w"):
+                        pass
+                    Config().persist(rhn_cronjob)
+
                     system.service("rhsmcertd", "start")
                     configs = ["/var/lib/rhsm/cache/installed_products.json",
                                "/var/lib/rhsm/facts/facts.json"]


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

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



More information about the node-patches mailing list