Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: Do not add many empty lines to /etc/exports
......................................................................

packaging: setup: Do not add many empty lines to /etc/exports

Change-Id: I035817c048518f77fc666cc6d5212c8e46edd65d
Signed-off-by: Yedidyah Bar David <d...@redhat.com>
---
M packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
1 file changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/09/20709/1

diff --git a/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py 
b/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
index 01c83fe..1efb2ac 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
@@ -118,22 +118,21 @@
         path = self.environment[
             osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT
         ]
-        content = '{path}\t0.0.0.0/0.0.0.0(rw)\n'.format(
-            path=path,
-        )
+        content = [
+            '{path}\t0.0.0.0/0.0.0.0(rw)'.format(
+                path=path,
+            )
+        ]
         if self._conf == osetupcons.FileLocations.NFS_EXPORT_FILE:
             with open(self._conf, 'r') as f:
-                export_content = f.readlines()
+                export_content = f.read().splitlines()
 
                 Found = False
                 for line in export_content:
                     if path in line:
                         Found = True
                 if not Found:
-                    content = '%s\n%s' % (
-                        '\n'.join(export_content),
-                        content
-                    )
+                    content = export_content + content
         else:
             self._delete_path(
                 path,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I035817c048518f77fc666cc6d5212c8e46edd65d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to