Set the `device` value in the attachment dict

We're currently not setting the device path in the attachment metadata
when using the legacy_attach workflow. Since we have this info, we might
as well set it.

Unsure whether this is correctly done for the new attach workflow,
though.

Change-Id: Ia3830b156400f6bf6d345e00215eb4667fe24474
This commit is contained in:
Flavio Percoco 2018-05-02 11:23:03 +02:00
parent b23f62201f
commit 297374e41b
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ class ConnectVolume(VolumeAction):
mountpoint, mode, hostname):
device_info = brick_connector.connect_volume(connection_data)
# NOTE(flaper87): mountpoint doesn't seem to be used at all, we should
# perhaps consider removing it from the connect args. Unsure whether
# `path` exists for all the different drivers so, using the value of
# `mountpoint` as the default.
mountpoint = device_info.get('path', mountpoint)
self.volumes_client.volumes.attach(self.volume_id, instance_uuid=None,
mountpoint=mountpoint,
mode=mode,