From a51d3f469b409d882842b07badf552182d271b79 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 6 Feb 2015 09:59:07 +0100 Subject: Don't enforce a kind of alarm rules Now, the alarm rules are extendable with stevedore in ceilometer API, so we should not enforce the list of supported alarm rule. This change does that. Change-Id: I06067bdd02cf88f6fd4cd060bdfa310ded504e65 --- ceilometerclient/v2/alarms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ceilometerclient/v2/alarms.py b/ceilometerclient/v2/alarms.py index 8eefa9b..cf8adc8 100644 --- a/ceilometerclient/v2/alarms.py +++ b/ceilometerclient/v2/alarms.py @@ -31,8 +31,6 @@ UPDATABLE_ATTRIBUTES = [ 'ok_actions', 'insufficient_data_actions', 'repeat_actions', - 'threshold_rule', - 'combination_rule', ] CREATION_ATTRIBUTES = UPDATABLE_ATTRIBUTES + ['project_id', 'user_id', 'time_constraints'] @@ -150,7 +148,8 @@ class AlarmManager(base.Manager): def create(self, **kwargs): self._compat_legacy_alarm_kwargs(kwargs, create=True) new = dict((key, value) for (key, value) in kwargs.items() - if key in CREATION_ATTRIBUTES) + if (key in CREATION_ATTRIBUTES + or key.endswith('_rule'))) return self._create(self._path(), new) def update(self, alarm_id, **kwargs): @@ -162,7 +161,8 @@ class AlarmManager(base.Manager): updated['time_constraints'] = self._merge_time_constraints( updated.get('time_constraints', []), kwargs) kwargs = dict((k, v) for k, v in kwargs.items() - if k in updated and k in UPDATABLE_ATTRIBUTES) + if k in updated and (k in UPDATABLE_ATTRIBUTES + or k.endswith('_rule'))) utils.merge_nested_dict(updated, kwargs, depth=1) return self._update(self._path(alarm_id), updated) -- cgit v1.2.1