Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: do not fail if /etc/exports is missing
......................................................................

packaging: setup: do not fail if /etc/exports is missing

Change-Id: Ie16fe7909ea61ec2f893f4ed88c324daa40f3cbf
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M packaging/fedora/setup/nfsutils.py
1 file changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/25/16625/1

diff --git a/packaging/fedora/setup/nfsutils.py 
b/packaging/fedora/setup/nfsutils.py
index ba0b3c7..b12384c 100644
--- a/packaging/fedora/setup/nfsutils.py
+++ b/packaging/fedora/setup/nfsutils.py
@@ -98,16 +98,17 @@
         comment = "#%s" % comment
     removed_exports = []
     new_lines = []
-    with open(exportFilePath, "r") as exportFile:
-        lines = exportFile.readlines()
-        for line in lines:
-            if comment in line or "#rhev installer" in line:
-                logging.debug("removing %s from %s" % (line, exportFilePath))
-                path = line.split("\t")[0]
-                removed_exports.append(path)
-                continue
-            else:
-                new_lines.append(line)
+    if os.path.exists(exportFilePath):
+        with open(exportFilePath, "r") as exportFile:
+            lines = exportFile.readlines()
+            for line in lines:
+                if comment in line or "#rhev installer" in line:
+                    logging.debug("removing %s from %s" % (line, 
exportFilePath))
+                    path = line.split("\t")[0]
+                    removed_exports.append(path)
+                    continue
+                else:
+                    new_lines.append(line)
     if len(removed_exports) == 0:
         # Unchanged
         return removed_exports


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie16fe7909ea61ec2f893f4ed88c324daa40f3cbf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to