Removed deprecated disk,raid and job state
Change-Id: I63e7bc013386449db8cf50aec1d9e80fe9a2c570
This commit is contained in:
parent
63e193a1c5
commit
3cb32a967a
|
@ -22,7 +22,7 @@ from dracclient import wsman
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
JobTuple = collections.namedtuple(
|
Job = collections.namedtuple(
|
||||||
'Job',
|
'Job',
|
||||||
['id', 'name', 'start_time', 'until_time', 'message', 'status',
|
['id', 'name', 'start_time', 'until_time', 'message', 'status',
|
||||||
'percent_complete'])
|
'percent_complete'])
|
||||||
|
@ -34,22 +34,6 @@ REBOOT_TYPES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Job(JobTuple):
|
|
||||||
|
|
||||||
def __new__(cls, **kwargs):
|
|
||||||
if 'state' in kwargs:
|
|
||||||
LOG.warning('Job.state is deprecated. Use Job.status instead.')
|
|
||||||
kwargs['status'] = kwargs['state']
|
|
||||||
del kwargs['state']
|
|
||||||
|
|
||||||
return super(Job, cls).__new__(cls, **kwargs)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
LOG.warning('Job.state is deprecated. Use Job.status instead.')
|
|
||||||
return self.status
|
|
||||||
|
|
||||||
|
|
||||||
class JobManagement(object):
|
class JobManagement(object):
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
|
|
|
@ -71,84 +71,24 @@ PHYSICAL_DISK_BUS_PROTOCOL = {
|
||||||
'8': 'nvme'
|
'8': 'nvme'
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicalDiskTuple = collections.namedtuple(
|
PhysicalDisk = collections.namedtuple(
|
||||||
'PhysicalDisk',
|
'PhysicalDisk',
|
||||||
['id', 'description', 'controller', 'manufacturer', 'model', 'media_type',
|
['id', 'description', 'controller', 'manufacturer', 'model', 'media_type',
|
||||||
'interface_type', 'size_mb', 'free_size_mb', 'serial_number',
|
'interface_type', 'size_mb', 'free_size_mb', 'serial_number',
|
||||||
'firmware_version', 'status', 'raid_status', 'sas_address',
|
'firmware_version', 'status', 'raid_status', 'sas_address',
|
||||||
'device_protocol'])
|
'device_protocol'])
|
||||||
|
|
||||||
|
|
||||||
class PhysicalDisk(PhysicalDiskTuple):
|
|
||||||
|
|
||||||
def __new__(cls, **kwargs):
|
|
||||||
if 'state' in kwargs:
|
|
||||||
LOG.warning('PhysicalDisk.state is deprecated. '
|
|
||||||
'Use PhysicalDisk.status instead.')
|
|
||||||
kwargs['status'] = kwargs['state']
|
|
||||||
del kwargs['state']
|
|
||||||
|
|
||||||
if 'raid_state' in kwargs:
|
|
||||||
LOG.warning('PhysicalDisk.raid_state is deprecated. '
|
|
||||||
'Use PhysicalDisk.raid_status instead.')
|
|
||||||
kwargs['raid_status'] = kwargs['raid_state']
|
|
||||||
del kwargs['raid_state']
|
|
||||||
|
|
||||||
return super(PhysicalDisk, cls).__new__(cls, **kwargs)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
LOG.warning('PhysicalDisk.state is deprecated. '
|
|
||||||
'Use PhysicalDisk.status instead.')
|
|
||||||
return self.status
|
|
||||||
|
|
||||||
@property
|
|
||||||
def raid_state(self):
|
|
||||||
LOG.warning('PhysicalDisk.raid_state is deprecated. '
|
|
||||||
'Use PhysicalDisk.raid_status instead.')
|
|
||||||
return self.raid_status
|
|
||||||
|
|
||||||
RAIDController = collections.namedtuple(
|
RAIDController = collections.namedtuple(
|
||||||
'RAIDController', ['id', 'description', 'manufacturer', 'model',
|
'RAIDController', ['id', 'description', 'manufacturer', 'model',
|
||||||
'primary_status', 'firmware_version', 'bus'])
|
'primary_status', 'firmware_version', 'bus'])
|
||||||
|
|
||||||
VirtualDiskTuple = collections.namedtuple(
|
VirtualDisk = collections.namedtuple(
|
||||||
'VirtualDisk',
|
'VirtualDisk',
|
||||||
['id', 'name', 'description', 'controller', 'raid_level', 'size_mb',
|
['id', 'name', 'description', 'controller', 'raid_level', 'size_mb',
|
||||||
'status', 'raid_status', 'span_depth', 'span_length',
|
'status', 'raid_status', 'span_depth', 'span_length',
|
||||||
'pending_operations', 'physical_disks'])
|
'pending_operations', 'physical_disks'])
|
||||||
|
|
||||||
|
|
||||||
class VirtualDisk(VirtualDiskTuple):
|
|
||||||
|
|
||||||
def __new__(cls, **kwargs):
|
|
||||||
if 'state' in kwargs:
|
|
||||||
LOG.warning('VirtualDisk.state is deprecated. '
|
|
||||||
'Use VirtualDisk.status instead.')
|
|
||||||
kwargs['status'] = kwargs['state']
|
|
||||||
del kwargs['state']
|
|
||||||
|
|
||||||
if 'raid_state' in kwargs:
|
|
||||||
LOG.warning('VirtualDisk.raid_state is deprecated. '
|
|
||||||
'Use VirtualDisk.raid_status instead.')
|
|
||||||
kwargs['raid_status'] = kwargs['raid_state']
|
|
||||||
del kwargs['raid_state']
|
|
||||||
|
|
||||||
return super(VirtualDisk, cls).__new__(cls, **kwargs)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
LOG.warning('VirtualDisk.state is deprecated. '
|
|
||||||
'Use VirtualDisk.status instead.')
|
|
||||||
return self.status
|
|
||||||
|
|
||||||
@property
|
|
||||||
def raid_state(self):
|
|
||||||
LOG.warning('VirtualDisk.raid_state is deprecated. '
|
|
||||||
'Use VirtualDisk.raid_status instead.')
|
|
||||||
return self.raid_status
|
|
||||||
|
|
||||||
|
|
||||||
class RAIDManagement(object):
|
class RAIDManagement(object):
|
||||||
|
|
||||||
NOT_SUPPORTED_MSG = " operation is not supported on th"
|
NOT_SUPPORTED_MSG = " operation is not supported on th"
|
||||||
|
|
Loading…
Reference in New Issue