From 2950eacd3828b3631c5597eae5558c55e9b9a078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Albert?= Date: Mon, 14 Sep 2015 10:56:54 +0200 Subject: [PATCH] Removed default values on rating modules Every setting can be now changed without passing other values. Change-Id: I3302617c266111ba1d705d04f1acf20b9348614d --- cloudkitty/api/v1/controllers/rating.py | 4 ++-- cloudkitty/api/v1/datamodels/rating.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudkitty/api/v1/controllers/rating.py b/cloudkitty/api/v1/controllers/rating.py index 22a69581..a8ddd880 100644 --- a/cloudkitty/api/v1/controllers/rating.py +++ b/cloudkitty/api/v1/controllers/rating.py @@ -97,9 +97,9 @@ class ModulesController(rest.RestController): ext = self.extensions[module_id].obj except KeyError: pecan.abort(404, 'Module not found.') - if ext.enabled != module.enabled: + if module.enabled != wtypes.Unset and ext.enabled != module.enabled: ext.set_state(module.enabled) - if ext.priority != module.priority: + if module.priority != wtypes.Unset and ext.priority != module.priority: ext.set_priority(module.priority) pecan.response.location = pecan.request.path diff --git a/cloudkitty/api/v1/datamodels/rating.py b/cloudkitty/api/v1/datamodels/rating.py index cd65b48f..9fcb8680 100644 --- a/cloudkitty/api/v1/datamodels/rating.py +++ b/cloudkitty/api/v1/datamodels/rating.py @@ -79,13 +79,13 @@ class CloudkittyModule(wtypes.Base): description = wtypes.wsattr(wtypes.text, mandatory=False) """Short description of the extension.""" - enabled = wtypes.wsattr(bool, default=False) + enabled = wtypes.wsattr(bool) """Extension status.""" hot_config = wtypes.wsattr(bool, default=False, name='hot-config') """On-the-fly configuration support.""" - priority = wtypes.wsattr(int, default=1) + priority = wtypes.wsattr(int) """Priority of the extension.""" @classmethod