diff --git a/proliantutils/redfish/redfish.py b/proliantutils/redfish/redfish.py index 25fe542..b1f6b11 100644 --- a/proliantutils/redfish/redfish.py +++ b/proliantutils/redfish/redfish.py @@ -349,7 +349,7 @@ class RedfishOperations(operations.IloOperations): manager = self._get_sushy_manager(PROLIANT_MANAGER_ID) try: vmedia_device = ( - manager.virtual_media.get_member_from_device( + manager.virtual_media.get_member_device( VIRTUAL_MEDIA_MAP[device])) if not vmedia_device.inserted: LOG.debug(self._("No media available in the device '%s' to " @@ -379,7 +379,7 @@ class RedfishOperations(operations.IloOperations): manager = self._get_sushy_manager(PROLIANT_MANAGER_ID) try: vmedia_device = ( - manager.virtual_media.get_member_from_device( + manager.virtual_media.get_member_device( VIRTUAL_MEDIA_MAP[device])) if vmedia_device.inserted: vmedia_device.eject_vmedia() @@ -425,7 +425,7 @@ class RedfishOperations(operations.IloOperations): manager = self._get_sushy_manager(PROLIANT_MANAGER_ID) try: vmedia_device = ( - manager.virtual_media.get_member_from_device( + manager.virtual_media.get_member_device( VIRTUAL_MEDIA_MAP[device])) vmedia_device.set_vm_status(BOOT_OPTION_MAP[boot_option]) except sushy.exceptions.SushyError as e: diff --git a/proliantutils/redfish/resources/manager/virtual_media.py b/proliantutils/redfish/resources/manager/virtual_media.py index 4221651..b0edd1c 100644 --- a/proliantutils/redfish/resources/manager/virtual_media.py +++ b/proliantutils/redfish/resources/manager/virtual_media.py @@ -111,7 +111,7 @@ class VirtualMediaCollection(base.ResourceCollectionBase): def _resource_type(self): return VirtualMedia - def get_member_from_device(self, device): + def get_member_device(self, device): """Returns the given virtual media device object. :param device: virtual media device to be queried diff --git a/proliantutils/tests/redfish/resources/manager/__init__.py b/proliantutils/tests/redfish/resources/manager/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/proliantutils/tests/redfish/resources/test_manager.py b/proliantutils/tests/redfish/resources/manager/test_manager.py similarity index 100% rename from proliantutils/tests/redfish/resources/test_manager.py rename to proliantutils/tests/redfish/resources/manager/test_manager.py diff --git a/proliantutils/tests/redfish/resources/test_virtual_media.py b/proliantutils/tests/redfish/resources/manager/test_virtual_media.py similarity index 97% rename from proliantutils/tests/redfish/resources/test_virtual_media.py rename to proliantutils/tests/redfish/resources/manager/test_virtual_media.py index c701fed..e1310de 100644 --- a/proliantutils/tests/redfish/resources/test_virtual_media.py +++ b/proliantutils/tests/redfish/resources/manager/test_virtual_media.py @@ -39,13 +39,13 @@ class VirtualMediaCollectionTestCase(testtools.TestCase): self.conn, '/redfish/v1/Managers/1/VirtualMedia', redfish_version='1.0.2') - def test_get_member_from_device(self): + def test_get_member_device(self): with open('proliantutils/tests/redfish/' 'json_samples/vmedia.json', 'r') as f: self.conn.get.return_value.json.return_value = ( json.loads(f.read())['default']) - obj = self.vmedia_coll_inst.get_member_from_device( + obj = self.vmedia_coll_inst.get_member_device( constants.VIRTUAL_MEDIA_CD) self.assertIsInstance(obj, virtual_media.VirtualMedia) diff --git a/proliantutils/tests/redfish/resources/system/__init__.py b/proliantutils/tests/redfish/resources/system/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/proliantutils/tests/redfish/resources/test_bios.py b/proliantutils/tests/redfish/resources/system/test_bios.py similarity index 100% rename from proliantutils/tests/redfish/resources/test_bios.py rename to proliantutils/tests/redfish/resources/system/test_bios.py diff --git a/proliantutils/tests/redfish/resources/test_system.py b/proliantutils/tests/redfish/resources/system/test_system.py similarity index 100% rename from proliantutils/tests/redfish/resources/test_system.py rename to proliantutils/tests/redfish/resources/system/test_system.py