From 08af8e029d6e3d785f6387eef294eafad28ad3e1 Mon Sep 17 00:00:00 2001 From: Craig Vyvial Date: Mon, 13 Oct 2014 10:56:44 -0500 Subject: [PATCH] restart_required cfg-param is bool and not string There was a break to the previous version of the configuration paramenters API when the configurations parameters were moved to the database. The actual type of the restart_required parameter should be a JSON boolean value, and not a string to be compatible with the previous configuration parameters API. Change-Id: If45944e25a55813ddf8f80010811da04d667ca19 Closes-Bug: #1379665 --- trove/configuration/views.py | 4 ++-- trove/extensions/mgmt/configuration/views.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trove/configuration/views.py b/trove/configuration/views.py index db8fa7fc6b..bde5dcce88 100644 --- a/trove/configuration/views.py +++ b/trove/configuration/views.py @@ -118,8 +118,8 @@ class ConfigurationParameterView(object): self.config = config def data(self): - # v1 api expects this to be a 'true' or 'false' string instead of 1/0 - restart_required = 'true' if self.config.restart_required else 'false' + # v1 api is to be a 'true' or 'false' json boolean instead of 1/0 + restart_required = True if self.config.restart_required else False ret = { "name": self.config.name, "datastore_version_id": self.config.datastore_version_id, diff --git a/trove/extensions/mgmt/configuration/views.py b/trove/extensions/mgmt/configuration/views.py index fa45e82403..08b515632e 100644 --- a/trove/extensions/mgmt/configuration/views.py +++ b/trove/extensions/mgmt/configuration/views.py @@ -24,10 +24,12 @@ class MgmtConfigurationParameterView(object): self.config = config def data(self): + # v1 api is to be a 'true' or 'false' json boolean instead of 1/0 + restart_required = True if self.config.restart_required else False ret = { "name": self.config.name, "datastore_version_id": self.config.datastore_version_id, - "restart_required": self.config.restart_required, + "restart_required": restart_required, "type": self.config.data_type, "deleted": self.config.deleted, "deleted_at": self.config.deleted_at,