Simone Tiraboschi has uploaded a new change for review.

Change subject: deploy: better matching of NFS exports paths
......................................................................

deploy: better matching of NFS exports paths

The user can input the NFS path including a trailing '/', ignoring it while 
matching
with VDSM responce.

Change-Id: Id7d7d7d5b07e6c47e4fbfb2c6099e2b0b049c35c
Bug-Url: https://bugzilla.redhat.com/1002454
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/plugins/ovirt-hosted-engine-setup/storage/storage.py
1 file changed, 16 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/07/36307/1

diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py 
b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
index a083e0a..fd3ce1e 100644
--- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
+++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
@@ -277,7 +277,15 @@
             self._RE_NOT_ALPHANUMERIC.search(name)
         ):
             return False
-        return True
+
+    def _removeNFSTrailingSlash(self, path):
+        nfspath = path.split(":")
+        nfspath[0]
+        if len(nfspath[1]) > 1:
+            ename = nfspath[1].rstrip('/')
+        else:
+            ename = nfspath[1]
+        return nfspath[0] + ':' + ename
 
     def _getExistingDomain(self):
         if self.storageType in (
@@ -326,9 +334,13 @@
                 if (
                     domain_info and
                     'remotePath' in domain_info and
-                    domain_info['remotePath'] == self.environment[
-                        ohostedcons.StorageEnv.STORAGE_DOMAIN_CONNECTION
-                    ]
+                    self._removeNFSTrailingSlash(
+                        domain_info['remotePath']
+                    ) == self._removeNFSTrailingSlash(
+                        self.environment[
+                            ohostedcons.StorageEnv.STORAGE_DOMAIN_CONNECTION
+                        ]
+                    )
                 ):
                     self.domain_exists = True
                     self.environment[


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7d7d7d5b07e6c47e4fbfb2c6099e2b0b049c35c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to