Browse Source

Removed deprecated disk,raid and job state

Change-Id: I63e7bc013386449db8cf50aec1d9e80fe9a2c570
changes/62/601662/1
uday344 3 years ago
parent
commit
3cb32a967a
2 changed files with 3 additions and 79 deletions
  1. +1
    -17
      dracclient/resources/job.py
  2. +2
    -62
      dracclient/resources/raid.py

+ 1
- 17
dracclient/resources/job.py View File

@ -22,7 +22,7 @@ from dracclient import wsman
LOG = logging.getLogger(__name__)
JobTuple = collections.namedtuple(
Job = collections.namedtuple(
'Job',
['id', 'name', 'start_time', 'until_time', 'message', 'status',
'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):
def __init__(self, client):


+ 2
- 62
dracclient/resources/raid.py View File

@ -71,84 +71,24 @@ PHYSICAL_DISK_BUS_PROTOCOL = {
'8': 'nvme'
}
PhysicalDiskTuple = collections.namedtuple(
PhysicalDisk = collections.namedtuple(
'PhysicalDisk',
['id', 'description', 'controller', 'manufacturer', 'model', 'media_type',
'interface_type', 'size_mb', 'free_size_mb', 'serial_number',
'firmware_version', 'status', 'raid_status', 'sas_address',
'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', ['id', 'description', 'manufacturer', 'model',
'primary_status', 'firmware_version', 'bus'])
VirtualDiskTuple = collections.namedtuple(
VirtualDisk = collections.namedtuple(
'VirtualDisk',
['id', 'name', 'description', 'controller', 'raid_level', 'size_mb',
'status', 'raid_status', 'span_depth', 'span_length',
'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):
NOT_SUPPORTED_MSG = " operation is not supported on th"


Loading…
Cancel
Save