diff --git a/dracclient/resources/job.py b/dracclient/resources/job.py index 26bf85c..5bddec7 100644 --- a/dracclient/resources/job.py +++ b/dracclient/resources/job.py @@ -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): diff --git a/dracclient/resources/raid.py b/dracclient/resources/raid.py index c4f1973..56d648c 100644 --- a/dracclient/resources/raid.py +++ b/dracclient/resources/raid.py @@ -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"