self.context, volume, new_vol_type['id'])
volume = db.volume_get(elevated, volume.id)
+ self.assertEqual(0, len(self.notifier.notifications),
+ self.notifier.notifications)
self.assertEqual('available', volume['status'])
def _retype_volume_exec(self, driver, snap=False, policy='on-demand',
self.assertEqual('available', volume.status)
self.assertEqual(CONF.host, volume.host)
self.assertEqual(1, volumes_in_use)
+ self.assertEqual(1, len(self.notifier.notifications),
+ "Notifier count incorrect %s" %
+ (self.notifier.notifications))
+ self.assertEqual(vol_type['id'], self.notifier.notifications[0]
+ ['payload']['volume_type'])
+ self.assertEqual('volume.retype', self.notifier.notifications[0]
+ ['event_type'])
elif not exc:
self.assertEqual(old_vol_type['id'], volume.volume_type_id)
self.assertEqual('retyping', volume.status)
self.assertEqual(CONF.host, volume.host)
self.assertEqual(1, volumes_in_use)
+ self.assertEqual(1, len(self.notifier.notifications),
+ "Notifier count incorrect %s" %
+ (self.notifier.notifications))
+ self.assertEqual(vol_type['id'], self.notifier.notifications[0]
+ ['payload']['volume_type'])
+ self.assertEqual('volume.retype', self.notifier.notifications[0]
+ ['event_type'])
else:
self.assertEqual(old_vol_type['id'], volume.volume_type_id)
self.assertEqual('available', volume.status)
self.assertEqual(CONF.host, volume.host)
self.assertEqual(0, volumes_in_use)
+ self.assertEqual(0, len(self.notifier.notifications),
+ "Notifier count incorrect %s" %
+ (self.notifier.notifications))
def test_retype_volume_driver_success(self):
self._retype_volume_exec(True)
QUOTAS.commit(context, old_reservations, project_id=project_id)
if new_reservations:
QUOTAS.commit(context, new_reservations, project_id=project_id)
+ self._notify_about_volume_usage(
+ context, volume, "retype",
+ extra_usage_info={'volume_type': new_type_id})
self.publish_service_capabilities(context)
LOG.info(_LI("Retype volume completed successfully."),
resource=volume)