[PATCH 1/3] Fix the handling of nfs:// URLs.

David Shea dshea at redhat.com
Mon Mar 2 19:44:22 UTC 2015


Using .strip strips the first letters of the hostname if they happen be
n, f or s.
---
 pyanaconda/packaging/yumpayload.py | 2 +-
 pyanaconda/ui/tui/spokes/source.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 4f45171..aa9019f 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -656,7 +656,7 @@ reposdir=%s
         url = repo.baseurl
         if url and url.startswith("nfs://"):
             # Let the assignment throw ValueError for bad NFS urls from kickstart
-            (server, path) = url.strip("nfs://").split(":", 1)
+            (server, path) = url[6:].split(":", 1)
             mountpoint = "%s/%s.nfs" % (MOUNT_DIR, repo.name)
             self._setupNFS(mountpoint, server, path, None)
 
diff --git a/pyanaconda/ui/tui/spokes/source.py b/pyanaconda/ui/tui/spokes/source.py
index 67043dd..970a77d 100644
--- a/pyanaconda/ui/tui/spokes/source.py
+++ b/pyanaconda/ui/tui/spokes/source.py
@@ -311,7 +311,7 @@ class SpecifyNFSRepoSpoke(EditTUISpoke, SourceSwitchHandler):
             return False
 
         if self.args.server.startswith("nfs://"):
-            self.args.server = self.args.server.strip("nfs://")
+            self.args.server = self.args.server[6:]
 
         try:
             (self.data.method.server, self.data.method.dir) = self.args.server.split(":", 2)
-- 
2.1.0



More information about the anaconda-patches mailing list