Saggi Mizrahi has posted comments on this change.
Change subject: gluster: add task support ......................................................................
Patch Set 17:
(2 comments)
All in all much cleaner code. Smart move moving the gritty bits into another function.
I'd still like the interface modified.
.................................................... File vdsm/gluster/tasks.py Line 31: def _getTasksData(value): Line 32: data = {} Line 33: state = value['status'] Line 34: if value['taskType'] == TaskType.REBALANCE: Line 35: data = cli.volumeRebalanceStatus(value['volumeName']) still refetchin 'volumeName' and co instead of putting in a variable Line 36: elif value['taskType'] == TaskType.REMOVE_BRICK: Line 37: data = cli.volumeRemoveBrickStatus(value['volumeName'], Line 38: value['bricks']) Line 39: elif value['taskType'] == TaskType.REPLACE_BRICK:
Line 49: "data": summary} Line 50: Line 51: Line 52: @makePublic Line 53: def tasksList(taskId=None): I understand that it wants to model the *bad* VDSM task fwk but there is a good reason why we are getting rid of it as soon as we can. No reason to make the same mistakes. Please change it to a list. Line 54: details = {} Line 55: tasks = cli.volumeStatusAll() Line 56: for tid in tasks: Line 57: if taskId and tid != taskId: