[node-patches] Change in ovirt-node[master]: edit-node: handle the "file://" type of baseurl for yum repo
hadong0720 at gmail.com
hadong0720 at gmail.com
Thu Nov 14 05:51:07 UTC 2013
hadong has uploaded a new change for review.
Change subject: edit-node: handle the "file://" type of baseurl for yum repo
......................................................................
edit-node: handle the "file://" type of baseurl for yum repo
Change-Id: Ic44264f0c62c8785c0b4867fda1e45522d32fc1f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=928756
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M tools/edit-node
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/44/21244/1
diff --git a/tools/edit-node b/tools/edit-node
index 27d538a..bd1b7e9 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -1134,6 +1134,27 @@
print "Can't Bind Mount Repo File"
print output
return False
+ item = ""
+ try:
+ with open(options.repo, "r") as f:
+ for line in f.readlines():
+ if "file://" in line:
+ item = re.match(r'^baseurl=file://(.*)', \
+ line).group(1)
+ except:
+ item = ""
+ if os.path.exists(item):
+ os.system("mkdir %s/%s" % (self._instroot, item))
+ cmd = "mount -o bind %s %s/%s" \
+ % (item, self._instroot, item)
+ f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
+ stderr=STDOUT)
+ output, err = f.communicate()
+ if f.returncode > 0:
+ print cmd
+ print output
+ print "Can't Bind Mount rpm directory"
+ return False
return True
elif os.path.isdir(options.repo) or \
options.repo.lower().endswith(".iso"):
--
To view, visit http://gerrit.ovirt.org/21244
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic44264f0c62c8785c0b4867fda1e45522d32fc1f
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