Remove unnecessary connector stash in attachment_update

We don't need to stash the connector in the volume attachment
connection_info for new style volume attachments becaues it's
not used. This was copied from the initialize_connection method
which used it during detach of a volume, but for new style
volume attachments, we simply delete the volume attachment and
we don't need the original host connector.

Similarly, attachment_create wasn't stashing the connector either
if we created an attachment with a connector.

The two places that would use the stashed connector for an old
style attachment are:

1. DriverVolumeBlockDevice.detach
2. _get_stashed_volume_connector in the compute.API

But as noted, neither of those flows need the connector for a
new style attachment.

Change-Id: Ie028c26ea0436bfa0b613c9cffc6b6352792fc0a
This commit is contained in:
Matt Riedemann
2017-12-12 12:59:48 -05:00
parent d550fe883f
commit d9587afe16
2 changed files with 0 additions and 3 deletions

View File

@@ -374,7 +374,6 @@ class CinderApiTestCase(test.NoDBTestCase):
'connection_info': {
'attach_mode': 'rw',
'attached_at': fake_attachment.attached_at,
'connector': connector,
'data': {'foo': 'bar', 'target_lun': '1'},
'detached_at': None,
'driver_volume_type': 'fake_type',
@@ -405,7 +404,6 @@ class CinderApiTestCase(test.NoDBTestCase):
'connection_info': {
'attach_mode': 'rw',
'attached_at': fake_attachment.attached_at,
'connector': updated_connector,
'data': {'foo': 'bar', 'target_lun': '1'},
'detached_at': None,
'driver_volume_type': 'fake_type',

View File

@@ -666,7 +666,6 @@ class API(object):
attachment_id, _connector)
translated_attach_ref = _translate_attachment_ref(
attachment_ref.to_dict())
translated_attach_ref['connection_info']['connector'] = _connector
return translated_attach_ref
except cinder_exception.ClientException as ex:
with excutils.save_and_reraise_exception():