Hello Fred Rolland,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/63636

to review the following change.

Change subject: storage: add more info to NFS SD getInfo
......................................................................

storage: add more info to NFS SD getInfo

Adding vfs type and mount options to getInfo for NFS storage domains.

vdsClient -s 0 getStorageDomainInfo aca80499-88a3-42e8-ab38-4552a554d715

    vfsType = nfs
    uuid = aca80499-88a3-42e8-ab38-4552a554d715
    version = 3
    role = Master
    remotePath = 10.35.0.181:/home/storage_domains/sd1
    mountOptions = ['rw', 'relatime', 'vers=3', 'rsize=1048576',
                    'wsize=1048576', 'namlen=255', 'soft', 'nosharecache',
                    'proto=tcp', 'timeo=600', 'retrans=6', 'sec=sys',
                    'mountaddr=10.35.0.181', 'mountvers=3',
                    'mountport=20048', 'mountproto=udp',
                    'local_lock=none', 'addr=10.35.0.181']
    type = NFS
    class = Data
    pool = ['00000001-0001-0001-0001-000000000325']
    name = NFSSD

Change-Id: Id54d735a43871f94684e94395b1569c54c03e8ce
Bug-Url: https://bugzilla.redhat.com/1373930
Signed-off-by: Fred Rolland <froll...@redhat.com>
---
M vdsm/storage/nfsSD.py
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/63636/1

diff --git a/vdsm/storage/nfsSD.py b/vdsm/storage/nfsSD.py
index 07d0a41..1861319 100644
--- a/vdsm/storage/nfsSD.py
+++ b/vdsm/storage/nfsSD.py
@@ -121,6 +121,22 @@
         except mount.MountError:
             return ""
 
+    def getInfo(self):
+        """
+        Get storage domain info
+        """
+        # First call parent getInfo() - it fills in all the common details
+        info = fileSD.FileStorageDomain.getInfo(self)
+        # Now add nfsSD specific data
+        try:
+            mntrcd = mount.getMountFromTarget(self.mountpoint).getRecord()
+            info['vfsType'] = mntrcd.fs_vfstype
+            info['mountOptions']  = mntrcd.fs_mntops
+        except mount.MountError:
+            return info
+
+        return info
+
 
 def findDomain(sdUUID):
     return NfsStorageDomain(NfsStorageDomain.findDomainPath(sdUUID))


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id54d735a43871f94684e94395b1569c54c03e8ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Freddy Rolland <froll...@redhat.com>
Gerrit-Reviewer: Fred Rolland <froll...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to