[node-patches] Change in ovirt-node[master]: edit-node: support /etc/rhsm/ca to yum

hadong0720 at gmail.com hadong0720 at gmail.com
Wed Oct 15 10:56:27 UTC 2014


hadong has uploaded a new change for review.

Change subject: edit-node: support /etc/rhsm/ca to yum
......................................................................

edit-node: support /etc/rhsm/ca to yum

Mount bind /etc/rhsm/ca.

Change-Id: I37ac454137a1d86595dc5b6436f64f5074650539
Signed-off-by: hadong <hadong at redhat.com>
---
M tools/edit-node
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/75/34175/1

diff --git a/tools/edit-node b/tools/edit-node
index db5f965..f8b1076 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -967,6 +967,24 @@
 
         return True
 
+    def _setup_rhsm_ca(self):
+        print "Setting rhsm ca"
+        if os.path.exists("/etc/rhsm/ca"):
+            cmd = "mkdir -p %s/etc/rhsm/ca" % self._instroot
+            f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
+            output, err = f.communicate()
+            cmd = "mount -o bind %s %s/etc/rhsm/ca" % \
+                ("/etc/rhsm/ca", self._instroot)
+            f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
+                stderr=STDOUT)
+            output, err = f.communicate()
+            if f.returncode > 0:
+               print "Can't Bind /etc/rhsm/ca"
+               print output
+               return False
+
+        return True
+
     def _setup_yum_repo(self, options):
         print "Configuring Yum Repo"
         self.dd_dir = tempfile.mkdtemp(dir=os.path.abspath(self.tmpdir),
@@ -975,6 +993,9 @@
             return True
         else:
             if not self._setup_pki_entitlement():
+                return False
+
+            if not self._setup_rhsm_ca():
                 return False
 
             if os.path.isfile(options.repo) and \
@@ -1153,6 +1174,9 @@
         if os.path.exists(self._instroot + "/etc/pki/entitlement"):
             os.system("umount %s/etc/pki/entitlement" % self._instroot)
 
+        if os.path.exists(self._instroot + "/etc/rhsm/ca"):
+            os.system("umount %s/etc/rhsm/ca" % self._instroot)
+
         os.system("umount %s/etc/resolv.conf" % self._instroot)
         if os.path.exists(self._instroot + "/etc/yum.repos.d/plugin.repo"):
             try:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37ac454137a1d86595dc5b6436f64f5074650539
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list