Merge "remove resource if not created"

This commit is contained in:
Jenkins 2017-03-28 23:15:25 +00:00 committed by Gerrit Code Review
commit d6b10ac2b2
1 changed files with 4 additions and 1 deletions

View File

@ -400,9 +400,12 @@ class GnocchiDispatcher(dispatcher.MeterDispatcherBase,
# NOTE(sileht): resource created in the meantime
pass
except gnocchi_exc.ClientException as e:
LOG.error(six.text_type(e))
LOG.error(_LE('Error creating resource %(id)s: %(err)s'),
{'id': resource['id'], 'err': six.text_type(e)})
# We cannot post measures for this resource
# and we can't patch it later
del measures[resource['id']]
del resource_infos[resource['id']]
# NOTE(sileht): we have created missing resources/metrics,
# now retry to post measures