Freddy Rolland has posted comments on this change. Change subject: hsm: Support GUID list param in GetDeviceList ......................................................................
Patch Set 1: (6 comments) https://gerrit.ovirt.org/#/c/40661/1/client/vdsClient.py File client/vdsClient.py: Line 717 Line 718 Line 719 Line 720 Line 721 > Old code supported *no* argument, this code require at least 1 argument. Done Line 737: storageType = args[0] Line 738: else: Line 739: raise ValueError('Invalid argument "%s". Not a valid ' Line 740: 'storage type' % args[0]) Line 741: devList = args[1].split(',') > I don't understand what are you trying to do, and it looks too complicated. Done Line 742: Line 743: devices = self.s.getDeviceList(storageType, devList) Line 744: Line 745: if devices['status']['code']: https://gerrit.ovirt.org/#/c/40661/1/vdsm/API.py File vdsm/API.py: Line 1611: Line 1612: def getLVMVolumeGroups(self, storageType=None): Line 1613: return self._irs.getVGList(storageType) Line 1614: Line 1615: def getDeviceList(self, storageType=None, guidList=None): > Use "guids" like we use in other places. Do not include the type in the nam Done Line 1616: return self._irs.getDeviceList(storageType, guidList) Line 1617: Line 1618: def getDevicesVisibility(self, guidList): Line 1619: return self._irs.getDevicesVisibility(guidList) https://gerrit.ovirt.org/#/c/40661/1/vdsm/rpc/vdsmapi-schema.json File vdsm/rpc/vdsmapi-schema.json: Line 1481: # Since: 4.10.0 Line 1482: ## Line 1483: {'command': {'class': 'Host', 'name': 'getDeviceList'}, Line 1484: 'data': {'*storageType': 'BlockDeviceType', Line 1485: '*guidList': ['UUID']}, > - The parameter is called "guids" in the function - the schema must match t Done Line 1486: 'returns': ['BlockDeviceInfo']} Line 1487: Line 1488: ## Line 1489: # @DeviceVisibilityMap: https://gerrit.ovirt.org/#/c/40661/1/vdsm/storage/hsm.py File vdsm/storage/hsm.py: Line 2028: lambda dev: multipath.devIsFCP(dev.get("devtype")) Line 2029: Line 2030: devices = [] Line 2031: pvs = {} Line 2032: if guids is not None and len(guids) > 0: > No need to check is None and len() > 0. Just use: Done Line 2033: for guid in guids: Line 2034: try: Line 2035: pv = lvm.getPV(guid) Line 2036: except se.StorageException: https://gerrit.ovirt.org/#/c/40661/1/vdsm/storage/multipath.py File vdsm/storage/multipath.py: Line 188: return HBTL(*hbtl[0].split(":")) Line 189: Line 190: Line 191: def pathListIter(filterGuids=None): Line 192: filteringOn = filterGuids is not None and len(filterGuids) > 0 > No need for None and len() checks. We can replace the fileringOn with filte Reverting Line 193: filterLen = len(filterGuids) if filteringOn else -1 Line 194: devsFound = 0 Line 195: Line 196: knownSessions = {} -- To view, visit https://gerrit.ovirt.org/40661 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic173d94a132e617ae97353d38520a86bede657d7 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Fred Rolland <froll...@redhat.com> Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches