Change in vdsm[master]: gluster: volume snapshot list verb.
barumuga at redhat.com
barumuga at redhat.com
Thu Feb 5 12:25:19 UTC 2015
Bala.FA has posted comments on this change.
Change subject: gluster: volume snapshot list verb.
......................................................................
Patch Set 14:
(6 comments)
http://gerrit.ovirt.org/#/c/36087/14//COMMIT_MSG
Commit Message:
Line 13: present in a volume if volume name is provided. Else It gives
Line 14: list of all snapshot across the cluster
Line 15: Returns:
Line 16: {'v1': {'snapshots': [{'snapshotName': 'snap1_v1',
Line 17: 'napDscription': description of the snapshot,
Fix this typo. Why is 'description' changed to 'snapDescription'?
Line 18: 'snapshotUuid': '8add41ae-c60c-4023-'
Line 19: 'a1a6-5093a5d35603',
Line 20: 'createTime': '2014-10-27 16:25:03',
Line 21: 'snapVolume': '5eeaf23def3f446d898e1de8461a6aa7'
http://gerrit.ovirt.org/#/c/36087/14/vdsm/gluster/cli.py
File vdsm/gluster/cli.py:
Line 1222: """
Line 1223: {'v1': {'snapshots': [{'snapshotName': 'snap1_v1',
Line 1224: 'snapDescription': description of the snapshot,
Line 1225: 'snapshotUuid': '8add41ae-c60c-4023'
Line 1226: '-a1a6-5093a5d35603',
How abt having these as 'name', 'description', 'id' to have similarity with other verbs?
Line 1227: 'createTime': '2014-10-27 16:25:03',
Line 1228: 'snapVolume': '5eeaf23def3f446d898e1de8461a6aa7'
Line 1229: 'snapVolumeStatus': 'ACTIVATED'}, ...],
Line 1230: 'snapRemaining': 252}
Line 1223: {'v1': {'snapshots': [{'snapshotName': 'snap1_v1',
Line 1224: 'snapDescription': description of the snapshot,
Line 1225: 'snapshotUuid': '8add41ae-c60c-4023'
Line 1226: '-a1a6-5093a5d35603',
Line 1227: 'createTime': '2014-10-27 16:25:03',
Is it good idea to convert the time into epoch time and sending timezone also? The assumption is all node in the gluster cluster are in same timezone
Line 1228: 'snapVolume': '5eeaf23def3f446d898e1de8461a6aa7'
Line 1229: 'snapVolumeStatus': 'ACTIVATED'}, ...],
Line 1230: 'snapRemaining': 252}
Line 1231: }
Line 1246: else el.find('description').text
Line 1247: snapshot['createTime'] = el.find('createTime').text
Line 1248: snapshot['snapVolume'] = el.find('snapVolume/name').text
Line 1249: status = el.find('snapVolume/status').text
Line 1250: if status == 'Started':
its better to use status.upper() == 'STARTED'
Line 1251: snapshot['snapVolumeStatus'] = SnapshotStatus.ACTIVATED
Line 1252: else:
Line 1253: snapshot['snapVolumeStatus'] = SnapshotStatus.DEACTIVATED
Line 1254: snapshot['snapshotName'] = el.find('name').text
Line 1276: 'snapRemaining': 252},...
Line 1277: }
Line 1278: """
Line 1279: volumes = {}
Line 1280: if tree.find('snapInfo/count').text == 0:
int() is missing
Line 1281: return {}
Line 1282: for el in tree.findall('snapInfo/snapshots/snapshot'):
Line 1283: snapshot = {}
Line 1284: snapshot['snapshotUuid'] = el.find('uuid').text
Line 1298: 'snapRemaining': el.find(
Line 1299: 'snapVolume/originVolume/snapRemaining').text,
Line 1300: 'snapshots': []
Line 1301: }
Line 1302: volumes[volumeName]['snapshots'].append(snapshot)
same as above
Line 1303: return volumes
Line 1304:
Line 1305:
Line 1306: @makePublic
--
To view, visit http://gerrit.ovirt.org/36087
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I06945d6781432b7fb40e417dd21c0ecf107de132
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Sahina Bose <sabose at redhat.com>
Gerrit-Reviewer: Shubhendu Tripathi <shtripat at redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list