[node-patches] Change in ovirt-node[master]: Skip running rhn autoinstall script when it's already regist...

fabiand at redhat.com fabiand at redhat.com
Fri Jul 25 11:59:57 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: Skip running rhn autoinstall script when it's already registered
......................................................................

Skip running rhn autoinstall script when it's already registered

rhbz#1045990

Change-Id: I409181a8e894c865f5597cb92265196006271e37
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M plugins/rhn_autoinstall.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/00/30700/1

diff --git a/plugins/rhn_autoinstall.py b/plugins/rhn_autoinstall.py
index 827733e..42176d8 100644
--- a/plugins/rhn_autoinstall.py
+++ b/plugins/rhn_autoinstall.py
@@ -20,9 +20,13 @@
 # also available at http://www.gnu.org/copyleft/gpl.html.
 
 from ovirt.node.utils.console import TransactionProgress
+from ovirt.node.utils.fs import Config
 from ovirt.node.setup.rhn import rhn_model
 import ovirtnode.ovirtfunctions as _functions
 from ovirt.node.plugins import Changeset
+
+RHSM_CONF = "/etc/rhsm/rhsm.conf"
+SYSTEMID = "/etc/sysconfig/rhn/systemid"
 
 args = _functions.get_cmdline_args()
 keys = ["rhn_type", "rhn_url", "rhn_ca_cert", "rhn_username",
@@ -43,6 +47,10 @@
 changes = dict((keys_to_model[key], args[key]) for key in keys if key in args)
 
 if __name__ == "__main__":
+    cfg = Config()
+    if cfg.exists(RHSM_CONF) or cfg.exists(SYSTEMID):
+        # skip rerunning again
+        exit()
     rhn = rhn_model.RHN()
     cfg = rhn.retrieve()
     rhn_password = _functions.OVIRT_VARS["OVIRT_RHN_PASSWORD"] \


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I409181a8e894c865f5597cb92265196006271e37
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list