Sandro Bonazzola has uploaded a new change for review.

Change subject: storage: avoid tracebacks mixing storage domains
......................................................................

storage: avoid tracebacks mixing storage domains

Avoid traceback like:
"/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/storage/storage.py",
line 340, in _getExistingDomain
    domain_info['remotePath']
  File
"/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/storage/storage.py",
line 283, in _removeNFSTrailingSlash
    if len(nfspath[1]) > 1:
IndexError: list index out of range

when checking NFS storage domains on a VDSM instance running with a
non NFS/Gluster domain already attached.

Change-Id: I4d653a3ab0b6bb324a9380ee351307ca7ebb34bc
Signed-off-by: Sandro Bonazzola <sbona...@redhat.com>
---
M src/plugins/ovirt-hosted-engine-setup/storage/storage.py
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py 
b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
index 2044599..6926c0c 100644
--- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
+++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
@@ -279,7 +279,6 @@
 
     def _removeNFSTrailingSlash(self, path):
         nfspath = path.split(":")
-        nfspath[0]
         if len(nfspath[1]) > 1:
             ename = nfspath[1].rstrip('/')
         else:
@@ -336,6 +335,11 @@
                 if (
                     domain_info and
                     'remotePath' in domain_info and
+                    'type' in domain_info and
+                    domain_info['type'] in (
+                        ohostedcons.VDSMConstants.NFS_DOMAIN,
+                        ohostedcons.VDSMConstants.GLUSTERFS_DOMAIN,
+                    ) and
                     self._removeNFSTrailingSlash(
                         domain_info['remotePath']
                     ) == self._removeNFSTrailingSlash(


-- 
To view, visit https://gerrit.ovirt.org/39362
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d653a3ab0b6bb324a9380ee351307ca7ebb34bc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to