Browse Source

Trigger volume deletes only on volume deleted

It was possible to create a volume and to do the following operations
with the volume; at the end, the volume itself is marked as ended, but
the volume is still available.

openstack volume create --size x foo
openstack volume snapshot create --volume <id> foo_snap
openstack volume create --snapshot <id_of_snap> clone
openstack volume delete --purge <id_of_foo>

openstack metric resource show <id_of_foo>

This commit fixes that issue.

Change-Id: I55f0667c71ba4f3a33959a44bef43c3b05bc097c
(cherry picked from commit f8992d40a1)
(cherry picked from commit 4185147ddd)
changes/63/738563/2
Matthias Runge 1 month ago
parent
commit
4aab9fac33
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      ceilometer/publisher/data/gnocchi_resources.yaml
  2. +3
    -3
      ceilometer/tests/unit/publisher/test_gnocchi.py

+ 2
- 2
ceilometer/publisher/data/gnocchi_resources.yaml View File

@@ -248,8 +248,8 @@ resources:
image_id: resource_metadata.image_id
instance_id: resource_metadata.instance_id
event_delete:
- volume.delete.start
- snapshot.delete.start
- volume.delete.end
- snapshot.delete.end
event_attributes:
id: resource_id



+ 3
- 3
ceilometer/tests/unit/publisher/test_gnocchi.py View File

@@ -111,8 +111,8 @@ IMAGE_DELETE_START = models.Event(
)


VOLUME_DELETE_START = models.Event(
event_type=u'volume.delete.start',
VOLUME_DELETE_END = models.Event(
event_type=u'volume.delete.end',
traits=[models.Trait(u'availability_zone', 1, u'nova'),
models.Trait(u'created_at', 1, u'2016-11-28T13:19:53+00:00'),
models.Trait(u'display_name', 1, u'vol-001'),
@@ -549,7 +549,7 @@ class PublisherWorkflowTest(base.BaseTestCase,

self.publisher.publish_events([INSTANCE_DELETE_START,
IMAGE_DELETE_START,
VOLUME_DELETE_START,
VOLUME_DELETE_END,
FLOATINGIP_DELETE_END])
self.assertEqual(8, len(fakeclient.mock_calls))
for call in expected_calls:


Loading…
Cancel
Save