Add check_storage_configuration to Redfish code.
Change-Id: Id604fdeb19e4dd571f6bad4e9b29276dc7001587
This commit is contained in:
parent
66e47992a7
commit
14652e8d84
|
@ -1268,6 +1268,16 @@ class Command(object):
|
|||
"""
|
||||
return self.oem.apply_storage_configuration(cfgspec)
|
||||
|
||||
def check_storage_configuration(self, cfgspec=None):
|
||||
"""Evaluate a configuration for validity
|
||||
|
||||
This will check if configuration is currently available and, if given,
|
||||
whether the specified cfgspec can be applied.
|
||||
:param cfgspec: A pyghmi.storage.ConfigSpec describing desired oonfig
|
||||
:return:
|
||||
"""
|
||||
return self._oem.check_storage_configuration(cfgspec)
|
||||
|
||||
def attach_remote_media(self, url, username=None, password=None):
|
||||
"""Attach remote media by url
|
||||
|
||||
|
|
|
@ -672,6 +672,10 @@ class OEMHandler(object):
|
|||
raise exc.UnsupportedFunctionality(
|
||||
'Remote storage configuration not supported on this platform')
|
||||
|
||||
def check_storage_configuration(self, cfgspec):
|
||||
raise exc.UnsupportedFunctionality(
|
||||
'Remote storage configuration not supported on this platform')
|
||||
|
||||
def upload_media(self, filename, progress=None, data=None):
|
||||
raise exc.UnsupportedFunctionality(
|
||||
'Remote media upload not supported on this platform')
|
||||
|
|
|
@ -725,6 +725,19 @@ class OEMHandler(generic.OEMHandler):
|
|||
themap[raidname] = mapdata
|
||||
return themap
|
||||
|
||||
def check_storage_configuration(self, cfgspec=None):
|
||||
rsp = self.wc.grab_json_response(
|
||||
'/api/function/raid_conf?params=raidlink_GetStatus')
|
||||
if rsp['items'][0]['status'] not in (2, 3):
|
||||
raise pygexc.TemporaryError('Storage configuration unavailable in '
|
||||
'current state (try boot to setup or '
|
||||
'an OS)')
|
||||
if not cfgspec:
|
||||
return True
|
||||
for pool in cfgspec.arrays:
|
||||
self._parse_storage_cfgspec(pool)
|
||||
return True
|
||||
|
||||
def _wait_storage_async(self):
|
||||
rsp = {'items': [{'status': 0}]}
|
||||
while rsp['items'][0]['status'] == 0:
|
||||
|
|
Loading…
Reference in New Issue