[node-patches] Change in ovirt-node[master]: Fix edit-node to work with repos again

rbarry at redhat.com rbarry at redhat.com
Tue Aug 12 16:06:52 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Fix edit-node to work with repos again
......................................................................

Fix edit-node to work with repos again

Pull the right filename out of mkstemp() instead of a tuple, don't
blindly check for file://, which can also match GPG keys, make
sure we actually find a file-based repo before we try bind
mounting

Change-Id: Ic6751fac97cf8e094815a2a4477f340ca422e4bf
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M tools/edit-node
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/20/31420/1

diff --git a/tools/edit-node b/tools/edit-node
index 9287953..122a3ff 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -958,7 +958,7 @@
                     rpms_path = "/tmp/rpms"
                     with open(options.repo, "r") as f:
                         for line in f.readlines():
-                            if "file://" in line:
+                            if "file://" in line and not line.startswith("gpg"):
                                 self.item = re.match(r'.*file://(.*)', \
                                                      line).group(1)
                                 conf_builder += re.sub(r'(.*file://).*',
@@ -969,9 +969,9 @@
                 except:
                     self.item = ""
                     logging.warning("Failed to get the path from repo file")
-                if os.path.exists(self.item):
+                if self.item and os.path.exists(self.item):
                     options.repo = tempfile.mkstemp(".repo")
-                    with open(options.repo, "w") as f:
+                    with open(options.repo[1], "w") as f:
                         f.write(conf_builder)
                     self.tmprepo = options.repo
                     os.system("mkdir %s/tmp/rpms" % self._instroot)


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

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