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

dougsland at redhat.com dougsland at redhat.com
Thu Sep 4 12:07:27 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: edit-node: support /etc/pki/entitlement to yum
......................................................................

edit-node: support /etc/pki/entitlement to yum

Mount bind /etc/pki/entitlement.
Thanks to hadong <hadong AT redhat.com> for the initial patch suggestion.

Change-Id: I528b4939e6912c95f7d04cf7bcb283511e0bd982
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1136239
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M tools/edit-node
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/68/32468/1

diff --git a/tools/edit-node b/tools/edit-node
index 573df52..653dc9b 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -940,6 +940,23 @@
         os.system("mount -o bind /etc/resolv.conf %s/etc/resolv.conf" %
                   self._instroot)
 
+    def _setup_pki_entitlement(self):
+        print "Setting pki entitlement"
+        if os.path.exists("/etc/pki/entitlement"):
+            cmd = "mkdir -p %s/etc/pki/entitlement" % self._instroot
+            f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
+            cmd = "mount -o bind %s %s/etc/pki/entitlement" % \
+                ("/etc/pki/entitlement", 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/pki/entitlement"
+               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),
@@ -947,6 +964,9 @@
         if not options.repo:
             return True
         else:
+            if not self._setup_pki_entitlement():
+                return False
+
             if os.path.isfile(options.repo) and \
                     options.repo.lower().endswith(".repo"):
                 cmd = "mkdir -p %s/etc/yum.repos.d" % self._instroot
@@ -1120,6 +1140,9 @@
 
     def _cleanup_editing(self):
         print "Cleaning Up Yum Configuration"
+        if os.path.exists(self._instroot + "/etc/pki/entitlement"):
+            os.system("umount %s/etc/pki/entitlement" % 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/32468
To unsubscribe, visit http://gerrit.ovirt.org/settings

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



More information about the node-patches mailing list