Most other volume drivers have a 'volume_id' key in the
connection_info['data'] dict returned from initialize_connection, this
adds it to the rbd volume driver.
This is part of a bigger effort to standardize the connection_info dict
so that consumers like Nova can rely on a common set of keys when
processing connection_info.
Change-Id: I7aed56a93c4cc3be5e0e49da6ddc1f009fed3c18
mock_get_mon_addrs:
mock_get_mon_addrs.return_value = (hosts, ports)
+ volume_id = '0a83f0a3-ef6e-47b6-a8aa-20436bc9ed01'
expected = {
'driver_volume_type': 'rbd',
'data': {
'auth_enabled': False,
'auth_username': None,
'secret_type': 'ceph',
- 'secret_uuid': None, }
+ 'secret_uuid': None,
+ 'volume_id': volume_id
+ }
}
- volume = dict(name=self.volume_name)
+ volume = dict(name=self.volume_name, id=volume_id)
actual = self.driver.initialize_connection(volume, None)
self.assertDictMatch(expected, actual)
self.assertTrue(mock_get_mon_addrs.called)
'auth_enabled': (self.configuration.rbd_user is not None),
'auth_username': self.configuration.rbd_user,
'secret_type': 'ceph',
- 'secret_uuid': self.configuration.rbd_secret_uuid, }
+ 'secret_uuid': self.configuration.rbd_secret_uuid,
+ 'volume_id': volume['id'],
+ }
}
LOG.debug('connection data: %s', data)
return data