[PATCH] Do not allow passing empty NFS mount options to blivet.

Chris Lumens clumens at redhat.com
Fri May 3 17:49:09 UTC 2013


That'll end up with a string like "-o  <server>:<dir>" which is clearly
wrong.  It may not solve the real problem here, though.

Related: rhbz#958763, rhbz#959420
---
 pyanaconda/image.py              | 7 ++++++-
 pyanaconda/packaging/__init__.py | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index d415196..29367ca 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -148,9 +148,14 @@ def mountImageDirectory(method, storage):
 
         url = "%s:%s" % (method.server, path)
 
+        if not method.options:
+            options = "nolock"
+        elif "nolock" not in method.options:
+            options += ",nolock"
+
         while True:
             try:
-                blivet.util.mount(url, ISO_DIR, fstype="nfs", options=method.options)
+                blivet.util.mount(url, ISO_DIR, fstype="nfs", options=options)
             except OSError as e:
                 log.error("couldn't mount ISO source directory: %s" % e)
                 exn = MediaMountError(str(e))
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 27de538..ba60965 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -509,6 +509,11 @@ class Payload(object):
         # mount the specified directory
         url = "%s:%s" % (server, path)
 
+        if not options:
+            options = "nolock"
+        elif "nolock" not in method.options:
+            options += ",nolock"
+
         try:
             blivet.util.mount(url, mountpoint, fstype="nfs", options=options)
         except OSError as e:
-- 
1.8.1.2



More information about the anaconda-patches mailing list