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:
@@ -170,8 +170,6 @@ class ScopeEndpoint(object):
|
|||||||
try:
|
try:
|
||||||
self._storage.delete(begin=state_dt, end=None, filters={
|
self._storage.delete(begin=state_dt, end=None, filters={
|
||||||
scope['scope_key']: scope['scope_id'],
|
scope['scope_key']: scope['scope_id'],
|
||||||
'collector': scope['collector'],
|
|
||||||
'fetcher': scope['fetcher'],
|
|
||||||
})
|
})
|
||||||
self._state.set_state(
|
self._state.set_state(
|
||||||
scope['scope_id'],
|
scope['scope_id'],
|
||||||
|
|||||||
@@ -84,18 +84,15 @@ class ScopeEndpointTest(tests.TestCase):
|
|||||||
begin=tzutils.utc_to_local(
|
begin=tzutils.utc_to_local(
|
||||||
datetime.datetime(2019, 7, 16, 8, 55, 1)),
|
datetime.datetime(2019, 7, 16, 8, 55, 1)),
|
||||||
end=None,
|
end=None,
|
||||||
filters={
|
filters={'project_id': 'f266f30b11f246b589fd266f85eeec39'}
|
||||||
'project_id': 'f266f30b11f246b589fd266f85eeec39',
|
),
|
||||||
'collector': 'prometheus',
|
|
||||||
'fetcher': 'prometheus'}),
|
|
||||||
mock.call(
|
mock.call(
|
||||||
begin=tzutils.utc_to_local(
|
begin=tzutils.utc_to_local(
|
||||||
datetime.datetime(2019, 7, 16, 8, 55, 1)),
|
datetime.datetime(2019, 7, 16, 8, 55, 1)),
|
||||||
end=None,
|
end=None,
|
||||||
filters={
|
filters={'project_id': '4dfb25b0947c4f5481daf7b948c14187'},
|
||||||
'project_id': '4dfb25b0947c4f5481daf7b948c14187',
|
)
|
||||||
'collector': 'gnocchi',
|
], any_order=True)
|
||||||
'fetcher': 'gnocchi'})], any_order=True)
|
|
||||||
|
|
||||||
ss.assert_has_calls([
|
ss.assert_has_calls([
|
||||||
mock.call(
|
mock.call(
|
||||||
|
|||||||
@@ -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.
|
||||||
Reference in New Issue
Block a user