[master 27/30] Fix the handling of nfs:// URLs.

KosiehBarter installerbot-noreply at redhat.com
Thu Jul 16 12:00:51 UTC 2015


From: David Shea <dshea at redhat.com>

Using .strip strips the first letters of the hostname if they happen be
n, f or s.

(cherry picked from commit c420772742cfbc4d5e7f9aaf580b41f6ca746e86)
---
 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 @@ def _configureAddOnRepo(self, repo):
         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 @@ def apply(self):
             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)


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/fe02b769a50368e19a83df83a57b5ad3b6ad79c7


More information about the anaconda-patches mailing list