[node-patches] Change in ovirt-node[master]: Don't use subprocess in rhn_model

rbarry at redhat.com rbarry at redhat.com
Thu Nov 6 18:34:23 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Don't use subprocess in rhn_model
......................................................................

Don't use subprocess in rhn_model

Use utils.process instead, so we log the calls.

Change-Id: Iff2af47a9e938e60c97236ec7a39c9205147d193
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1017098
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/rhn/rhn_model.py
1 file changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/04/34904/1

diff --git a/src/ovirt/node/setup/rhn/rhn_model.py b/src/ovirt/node/setup/rhn/rhn_model.py
index c7289d4..eb329fd 100644
--- a/src/ovirt/node/setup/rhn/rhn_model.py
+++ b/src/ovirt/node/setup/rhn/rhn_model.py
@@ -26,7 +26,6 @@
 import sys
 import os.path
 import glob
-import subprocess
 
 
 RHN_XMLRPC_ADDR = "https://xmlrpc.rhn.redhat.com/XMLRPC"
@@ -83,7 +82,7 @@
         try:
             cmd = ["wget", "-nd", "--no-check-certificate", "--timeout=30",
                    "--tries=3", "-O", dest, url]
-            subprocess.check_call(cmd)
+            process.check_call(cmd)
         except:
             raise RuntimeError("Error Downloading SSL Certificate!")
 
@@ -183,7 +182,7 @@
                 logged_args = str(logged_args)
                 self.logger.debug(logged_args)
                 try:
-                    subprocess.check_call(args)
+                    process.check_call(args)
                     conf.persist("/etc/sysconfig/rhn/up2date")
                     conf.persist("/etc/sysconfig/rhn/systemid")
                     self.logger.info("System %s sucessfully registered to %s" %
@@ -289,7 +288,7 @@
                     smconf.append('--rhsm.repo_ca_cert')
                     smconf.append('/etc/rhsm/ca/candlepin-local.pem')
                 try:
-                    subprocess.check_call(smconf)
+                    process.check_call(smconf)
                     conf.persist("/etc/rhsm/rhsm.conf")
                 except:
                     raise RuntimeError("Error updating subscription manager \
@@ -321,7 +320,7 @@
                                     logged_args[idx+1] = "XXXXXXX"
                                     logged_args = str(logged_args)
                             self.logger.info(logged_args)
-                            subprocess.check_call(cmd)
+                            process.check_call(cmd)
                     except:
                         raise RuntimeError("Error updating subscription \
                                            manager proxy configuration")
@@ -360,7 +359,7 @@
                     if activationkey:
                         cmd = ["subscription-manager", "auto-attach"]
                         try:
-                            subprocess.check_call(cmd)
+                            process.check_call(cmd)
                         except:
                             raise RuntimeError("Error Setting Auto Attach")
                     else:


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

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