Freddy Rolland has posted comments on this change.
Change subject: hsm: Support checkStatus param in getDeviceList
......................................................................
Patch Set 1:
(7 comments)
https://gerrit.ovirt.org/#/c/45093/1/client/vdsClient.py
File client/vdsClient.py:
Line 735: elif len(args) == 1:
Line 736: res = self.s.getDeviceList(args[0])
Line 737: else:
Line 738: res = self.s.getDeviceList(args[0],
Line 739: utils.tobool(args[1]), args[2:])
Check if utils.tobool(args[1]) can be on the first line, this
indentation l
Done
Line 740:
Line 741: if res['status']['code']:
Line 742: return res['status']['code'],
res['status']['message']
Line 743: pp.pprint(res['devList'])
Line 2282: ('[storageType]',
Line 2283: '[testPvCreate]',
Line 2284: '[<devlist>]',
Line 2285: 'List of all block devices (optionally -
matching '
Line 2286: 'storageType, optionally - perform PV create
test '
update name
Done
Line 2287: 'optionally - of each device listed).',
Line 2288: ' getDeviceList',
Line 2289: ' return all devices',
Line 2290: ' getDeviceList FCP',
https://gerrit.ovirt.org/#/c/45093/1/vdsm/rpc/vdsmapi-schema.json
File vdsm/rpc/vdsmapi-schema.json:
Line 1487
Line 1488
Line 1489
Line 1490
Line 1491
This type should be updated now, as status is optional, or it may
return th
I added a description for status enum that was missing, and added a third
value
Line 1477: #
Line 1478: # @storageType: #optional Only return devices of this type
Line 1479: #
Line 1480: # @testPvCreate: #optional Indicates if PV creation test should be performed
Line 1481: # (new in version 4.17)
Update to describe what this does instead of how.
Done
Line 1482: #
Line 1483: # @guids: #optional Only return info on specific list of block device
Line 1484: # GUIDs (new in version 4.17)
Line 1485: #
https://gerrit.ovirt.org/#/c/45093/1/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:
Line 1956: return pool.reconstructMaster(hostId, poolName, masterDom, domDict,
Line 1957: masterVersion, leaseParams)
Line 1958:
Line 1959: @public
Line 1960: def getDeviceList(self, storageType=None, testPvCreate=True,
This is too specific, what we want is to check the device status, so
lets c
Done
Line 1961: guids=(), options={}):
Line 1962: """
Line 1963: List all Block Devices.
Line 1964:
Line 1978: devices = self._getDeviceList(storageType=storageType,
Line 1979: testPvCreate=testPvCreate, guids=guids)
Line 1980: return dict(devList=devices)
Line 1981:
Line 1982: def _getDeviceList(self, storageType=None, testPvCreate=True, guids=()):
Update to new parameter name.
Done
Line 1983: sdCache.refreshStorage()
Line 1984: typeFilter = lambda dev: True
Line 1985: if storageType:
Line 1986: if sd.storageType(storageType) == sd.type2name(sd.ISCSI_DOMAIN):
Line 2046: guid = dev['GUID']
Line 2047: if guid in free:
Line 2048: dev['status'] = "free"
Line 2049: elif guid in used:
Line 2050: dev['status'] = "used"
This will not report device status now when new engine call with
checkStatu
Done
Line 2051: else:
Line 2052: raise KeyError("pvcreate response foresight is "
Line 2053: "can not be determined for %s",
dev)
Line 2054:
--
To view, visit
https://gerrit.ovirt.org/45093
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic28954708f2fd7c7b721aa7f9a0fb6e1a6019597
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Fred Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes