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
This commit is contained in:
Craig Vyvial 2014-10-13 10:56:44 -05:00 committed by Nikhil Manchanda
parent e94c68c786
commit 08af8e029d
2 changed files with 5 additions and 3 deletions

View File

@ -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,

View File

@ -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,