self.assertTrue(mock_create_folder_path.called)
self.assertEqual(self.FLDR, res, 'Unexpected Folder')
+ @mock.patch.object(dell_storagecenter_api.StorageCenterApi,
+ 'find_volume',
+ return_value=VOLUME)
@mock.patch.object(dell_storagecenter_api.StorageCenterApi,
'unmap_volume',
return_value=True)
mock_get_json,
mock_map_volume,
mock_unmap_volume,
+ mock_find_volume,
mock_close_connection,
mock_open_connection,
mock_init):
# Map to actually create the volume
self.map_volume(scvolume,
scserver)
+ # We have changed the volume so grab a new copy of it.
+ scvolume = self.find_volume(scvolume.get('name'))
self.unmap_volume(scvolume,
scserver)
return
:returns: A list of Dell mapping profile objects.
"""
mapping_profiles = []
- if scvolume.get('active', False):
- r = self.client.get('StorageCenter/ScVolume/%s/MappingProfileList'
- % self._get_id(scvolume))
- if r.status_code == 200:
- mapping_profiles = self._get_json(r)
- else:
- LOG.debug('MappingProfileList error: %(code)d %(reason)s',
- {'code': r.status_code,
- 'reason': r.reason})
- LOG.error(_LE('Unable to find volume mapping profiles: %s'),
- scvolume.get('name'))
+ r = self.client.get('StorageCenter/ScVolume/%s/MappingProfileList'
+ % self._get_id(scvolume))
+ if r.status_code == 200:
+ mapping_profiles = self._get_json(r)
else:
- LOG.error(_LE('_find_mappings: volume is not active'))
+ LOG.debug('MappingProfileList error: %(code)d %(reason)s',
+ {'code': r.status_code,
+ 'reason': r.reason})
LOG.debug(mapping_profiles)
return mapping_profiles