Hello Timothy Asir, Saggi Mizrahi, Aravinda VK, Dan Kenigsberg, Darshan N,

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

    http://gerrit.ovirt.org/23651

to review the following change.

Change subject: gluster: add host uuid in volume status
......................................................................

gluster: add host uuid in volume status

This patch adopts newly added host uuid in gluster volume status cli
output

Change-Id: Ia37fdb352cf4e2b22481b3d0c4543fbd22ca7735
Reviewed-on: http://gerrit.ovirt.org/21596
Reviewed-by: Timothy Asir <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
Signed-off-by: Bala.FA <[email protected]>
---
M tests/gluster_cli_tests.py
M vdsm/gluster/cli.py
2 files changed, 43 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/23651/1

diff --git a/tests/gluster_cli_tests.py b/tests/gluster_cli_tests.py
index 335c35d..b9cf176 100644
--- a/tests/gluster_cli_tests.py
+++ b/tests/gluster_cli_tests.py
@@ -230,6 +230,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b1</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49152</port>
           <status>1</status>
           <pid>1313</pid>
@@ -237,6 +238,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49153</port>
           <status>1</status>
           <pid>1335</pid>
@@ -244,6 +246,7 @@
         <node>
           <hostname>NFS Server</hostname>
           <path>192.168.122.2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>38467</port>
           <status>1</status>
           <pid>1357</pid>
@@ -251,6 +254,7 @@
         <node>
           <hostname>Self-heal Daemon</hostname>
           <path>192.168.122.2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>0</port>
           <status>1</status>
           <pid>1375</pid>
@@ -264,19 +268,27 @@
         status = gcli._parseVolumeStatus(tree)
         self.assertEquals(status,
                           {'bricks': [{'brick': '192.168.122.2:/tmp/music-b1',
+                                       'hostuuid':
+                                       'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                                        'pid': '1313',
                                        'port': '49152',
                                        'status': 'ONLINE'},
                                       {'brick': '192.168.122.2:/tmp/music-b2',
+                                       'hostuuid':
+                                       'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                                        'pid': '1335',
                                        'port': '49153',
                                        'status': 'ONLINE'}],
                            'name': 'music',
                            'nfs': [{'hostname': '192.168.122.2',
+                                    'hostuuid':
+                                    'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                                     'pid': '1357',
                                     'port': '38467',
                                     'status': 'ONLINE'}],
                            'shd': [{'hostname': '192.168.122.2',
+                                    'hostuuid':
+                                    'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                                     'pid': '1375',
                                     'status': 'ONLINE'}]})
 
@@ -294,6 +306,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b1</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49152</port>
           <status>1</status>
           <pid>1313</pid>
@@ -307,6 +320,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49153</port>
           <status>1</status>
           <pid>1335</pid>
@@ -325,6 +339,8 @@
         oStatus = \
             {'bricks': [{'blockSize': '4096',
                          'brick': '192.168.122.2:/tmp/music-b1',
+                         'hostuuid':
+                         'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                          'device': '/dev/vda1',
                          'fsName': 'ext4',
                          'mntOptions': 'rw,seclabel,relatime,data=ordered',
@@ -332,6 +348,8 @@
                          'sizeTotal': '7982.934'},
                         {'blockSize': '4096',
                          'brick': '192.168.122.2:/tmp/music-b2',
+                         'hostuuid':
+                         'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                          'device': '/dev/vda1',
                          'fsName': 'ext4',
                          'mntOptions': 'rw,seclabel,relatime,data=ordered',
@@ -355,6 +373,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b1</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49152</port>
           <status>1</status>
           <pid>1313</pid>
@@ -375,6 +394,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49153</port>
           <status>1</status>
           <pid>1335</pid>
@@ -402,6 +422,8 @@
         self.assertEquals(status.keys(), ['bricks', 'name'])
         self.assertEquals(status['name'], 'music')
         oBricks = [{'brick': '192.168.122.2:/tmp/music-b1',
+                    'hostuuid':
+                    'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                     'clientsStatus': [{'bytesRead': '1172',
                                        'bytesWrite': '792',
                                        'hostname': '192.168.122.2:1021'},
@@ -409,6 +431,8 @@
                                        'bytesWrite': '12152',
                                        'hostname': '192.168.122.2:1011'}]},
                    {'brick': '192.168.122.2:/tmp/music-b2',
+                    'hostuuid':
+                    'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                     'clientsStatus': [{'bytesRead': '1172',
                                        'bytesWrite': '792',
                                        'hostname': '192.168.122.2:1020'},
@@ -431,6 +455,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b1</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49152</port>
           <status>1</status>
           <pid>1452</pid>
@@ -605,6 +630,7 @@
         <node>
           <hostname>192.168.122.2</hostname>
           <path>/tmp/music-b2</path>
+          <peerid>f06b108e-a780-4519-bb22-c3083a1e3f8a</peerid>
           <port>49153</port>
           <status>1</status>
           <pid>1459</pid>
@@ -783,6 +809,8 @@
 """
         ostatus = \
             {'bricks': [{'brick': '192.168.122.2:/tmp/music-b1',
+                         'hostuuid':
+                         'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                          'mallinfo': {'arena': '606208',
                                       'fordblks': '132000',
                                       'fsmblks': '64',
@@ -914,6 +942,8 @@
                                       'padddedSizeOf': '172',
                                       'poolMisses': '0'}]},
                         {'brick': '192.168.122.2:/tmp/music-b2',
+                         'hostuuid':
+                         'f06b108e-a780-4519-bb22-c3083a1e3f8a',
                          'mallinfo': {'arena': '606208',
                                       'fordblks': '131984',
                                       'fsmblks': '128',
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index cba2062..afedf11 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -151,16 +151,19 @@
 
         if value['hostname'] == 'NFS Server':
             status['nfs'].append({'hostname': value['path'],
+                                  'hostuuid': value['peerid'],
                                   'port': value['port'],
                                   'status': value['status'],
                                   'pid': value['pid']})
         elif value['hostname'] == 'Self-heal Daemon':
             status['shd'].append({'hostname': value['path'],
+                                  'hostuuid': value['peerid'],
                                   'status': value['status'],
                                   'pid': value['pid']})
         else:
             status['bricks'].append({'brick': '%s:%s' % (value['hostname'],
                                                          value['path']),
+                                     'hostuuid': value['peerid'],
                                      'port': value['port'],
                                      'status': value['status'],
                                      'pid': value['pid']})
@@ -182,6 +185,7 @@
         value['sizeFree'] = sizeFree / (1024.0 * 1024.0)
         status['bricks'].append({'brick': '%s:%s' % (value['hostname'],
                                                      value['path']),
+                                 'hostuuid': value['peerid'],
                                  'sizeTotal': '%.3f' % (value['sizeTotal'],),
                                  'sizeFree': '%.3f' % (value['sizeFree'],),
                                  'device': value['device'],
@@ -197,6 +201,7 @@
     for el in tree.findall('volStatus/volumes/volume/node'):
         hostname = el.find('hostname').text
         path = el.find('path').text
+        hostuuid = el.find('peerid').text
 
         clientsStatus = []
         for c in el.findall('clientsStatus/client'):
@@ -208,6 +213,7 @@
                                   'bytesWrite': clientValue['bytesWrite']})
 
         status['bricks'].append({'brick': '%s:%s' % (hostname, path),
+                                 'hostuuid': hostuuid,
                                  'clientsStatus': clientsStatus})
     return status
 
@@ -218,6 +224,7 @@
     for el in tree.findall('volStatus/volumes/volume/node'):
         brick = {'brick': '%s:%s' % (el.find('hostname').text,
                                      el.find('path').text),
+                 'hostuuid': el.find('peerid').text,
                  'mallinfo': {},
                  'mempool': []}
 
@@ -247,20 +254,24 @@
        When option=None,
          {'name': NAME,
           'bricks': [{'brick': BRICK,
+                      'hostuuid': UUID,
                       'port': PORT,
                       'status': STATUS,
                       'pid': PID}, ...],
           'nfs': [{'hostname': HOST,
+                   'hostuuid': UUID,
                    'port': PORT,
                    'status': STATUS,
                    'pid': PID}, ...],
           'shd: [{'hostname': HOST,
+                  'hostuuid': UUID,
                   'status': STATUS,
                   'pid': PID}, ...]}
 
       When option='detail',
          {'name': NAME,
           'bricks': [{'brick': BRICK,
+                      'hostuuid': UUID,
                       'sizeTotal': SIZE,
                       'sizeFree': FREESIZE,
                       'device': DEVICE,
@@ -271,6 +282,7 @@
        When option='clients':
          {'name': NAME,
           'bricks': [{'brick': BRICK,
+                      'hostuuid': UUID,
                       'clientsStatus': [{'hostname': HOST,
                                          'bytesRead': BYTESREAD,
                                          'bytesWrite': BYTESWRITE}, ...]},
@@ -279,6 +291,7 @@
        When option='mem':
          {'name': NAME,
           'bricks': [{'brick': BRICK,
+                      'hostuuid': UUID,
                       'mallinfo': {'arena': int,
                                    'fordblks': int,
                                    'fsmblks': int,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia37fdb352cf4e2b22481b3d0c4543fbd22ca7735
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Bala.FA <[email protected]>
Gerrit-Reviewer: Aravinda VK <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Darshan N <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Timothy Asir <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to