Fix call to storage.delete() in ScopeEndpoint RPC endpoint

This removes the filters on fetcher and collector in the call to
storage.delete() in the ScopeEndpoint RPC endpoint.

Until now, a filter on the collector and the fetcher were passed to the
function, leading to no match from any point.

Change-Id: I4ad72870da08d9be7c1e0c27a6c89d6d27c49f8e
This commit is contained in:
Luka Peschke
2019-08-08 10:39:55 +02:00
parent cb6a653879
commit ecc4828c91
3 changed files with 10 additions and 10 deletions

View File

@@ -170,8 +170,6 @@ class ScopeEndpoint(object):
try:
self._storage.delete(begin=state_dt, end=None, filters={
scope['scope_key']: scope['scope_id'],
'collector': scope['collector'],
'fetcher': scope['fetcher'],
})
self._state.set_state(
scope['scope_id'],

View File

@@ -84,18 +84,15 @@ class ScopeEndpointTest(tests.TestCase):
begin=tzutils.utc_to_local(
datetime.datetime(2019, 7, 16, 8, 55, 1)),
end=None,
filters={
'project_id': 'f266f30b11f246b589fd266f85eeec39',
'collector': 'prometheus',
'fetcher': 'prometheus'}),
filters={'project_id': 'f266f30b11f246b589fd266f85eeec39'}
),
mock.call(
begin=tzutils.utc_to_local(
datetime.datetime(2019, 7, 16, 8, 55, 1)),
end=None,
filters={
'project_id': '4dfb25b0947c4f5481daf7b948c14187',
'collector': 'gnocchi',
'fetcher': 'gnocchi'})], any_order=True)
filters={'project_id': '4dfb25b0947c4f5481daf7b948c14187'},
)
], any_order=True)
ss.assert_has_calls([
mock.call(

View File

@@ -0,0 +1,5 @@
---
fixes:
- |
An issue causing data not to be deleted from the storage backend when
resetting a scope's state through the API has been fixed.