From e0bc432b942bf52b1bf7f83c1cc0eece99a28961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= Date: Fri, 30 Aug 2013 22:30:56 -0400 Subject: [PATCH] Send notifications when extending volume - Send resize.start when volume extension begins. - Send resize.end with new size when volume extension ends. Fixes: bug #1219106 Change-Id: I729da1604668080ec1a5d096df211aa55913dc48 --- cinder/volume/manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 4dea45a4f6..b48887ba79 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -795,6 +795,7 @@ def _consumed(name): 'd_quota': quotas['gigabytes']}) return + self._notify_about_volume_usage(context, volume, "resize.start") try: LOG.info(_("volume %s: extending"), volume['id']) self.driver.extend_volume(volume, new_size) @@ -812,3 +813,6 @@ def _consumed(name): QUOTAS.commit(context, reservations) self.db.volume_update(context, volume['id'], {'size': int(new_size), 'status': 'available'}) + self._notify_about_volume_usage( + context, volume, "resize.end", + extra_usage_info={'size': int(new_size)})