From 881fd0ad39318626e8e3509143e1f88aa69e8a4e Mon Sep 17 00:00:00 2001 From: Craig Vyvial Date: Tue, 2 Dec 2014 15:33:32 -0600 Subject: [PATCH] convert the max and min values to int instead of string Closes-Bug: #1390317 Change-Id: I6e8517308e51b4a8a03ad4fc27166934a6104841 --- ...er-for-datastore-version-response-json.txt | 2 +- ...ameter-for-datastore-version-response.json | 3 +-- ...ithout-datastore-version-response-json.txt | 2 +- ...er-without-datastore-version-response.json | 3 +-- ...rs-for-datastore-version-response-json.txt | 2 +- ...meters-for-datastore-version-response.json | 23 +++++++++---------- ...ithout-datastore-version-response-json.txt | 2 +- ...rs-without-datastore-version-response.json | 23 +++++++++---------- trove/configuration/views.py | 4 ++-- trove/tests/api/configurations.py | 4 ++-- 10 files changed, 32 insertions(+), 36 deletions(-) diff --git a/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response-json.txt b/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response-json.txt index 88efdd833f..60fde3a3f0 100644 --- a/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response-json.txt +++ b/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 149 +Content-Length: 147 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response.json b/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response.json index db0ebd9128..882f66000a 100644 --- a/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response.json +++ b/apidocs/src/samples/db-configuration-parameter-for-datastore-version-response.json @@ -1,8 +1,7 @@ { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "min": "0", + "min": 0, "name": "collation_server", "restart_required": false, "type": "string" } - diff --git a/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response-json.txt b/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response-json.txt index 88efdd833f..60fde3a3f0 100644 --- a/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response-json.txt +++ b/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 149 +Content-Length: 147 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response.json b/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response.json index db0ebd9128..882f66000a 100644 --- a/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response.json +++ b/apidocs/src/samples/db-configuration-parameter-without-datastore-version-response.json @@ -1,8 +1,7 @@ { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "min": "0", + "min": 0, "name": "collation_server", "restart_required": false, "type": "string" } - diff --git a/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response-json.txt b/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response-json.txt index 4ffc0d8e82..c5f57eff28 100644 --- a/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response-json.txt +++ b/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 1030 +Content-Length: 1008 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response.json b/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response.json index fb517d8bd3..b5d8663cd6 100644 --- a/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response.json +++ b/apidocs/src/samples/db-configuration-parameters-for-datastore-version-response.json @@ -2,51 +2,50 @@ "configuration-parameters": [ { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "min": "0", + "min": 0, "name": "collation_server", "restart_required": false, "type": "string" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "65535", - "min": "0", + "max": 65535, + "min": 0, "name": "connect_timeout", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "57671680", - "min": "0", + "max": 57671680, + "min": 0, "name": "innodb_buffer_pool_size", "restart_required": true, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "4294967296", - "min": "0", + "max": 4294967296, + "min": 0, "name": "join_buffer_size", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "4294967296", - "min": "0", + "max": 4294967296, + "min": 0, "name": "key_buffer_size", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "1", - "min": "0", + "max": 1, + "min": 0, "name": "local_infile", "restart_required": false, "type": "integer" } ] } - diff --git a/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response-json.txt b/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response-json.txt index 4ffc0d8e82..c5f57eff28 100644 --- a/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response-json.txt +++ b/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 1030 +Content-Length: 1008 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response.json b/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response.json index fb517d8bd3..b5d8663cd6 100644 --- a/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response.json +++ b/apidocs/src/samples/db-configuration-parameters-without-datastore-version-response.json @@ -2,51 +2,50 @@ "configuration-parameters": [ { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "min": "0", + "min": 0, "name": "collation_server", "restart_required": false, "type": "string" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "65535", - "min": "0", + "max": 65535, + "min": 0, "name": "connect_timeout", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "57671680", - "min": "0", + "max": 57671680, + "min": 0, "name": "innodb_buffer_pool_size", "restart_required": true, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "4294967296", - "min": "0", + "max": 4294967296, + "min": 0, "name": "join_buffer_size", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "4294967296", - "min": "0", + "max": 4294967296, + "min": 0, "name": "key_buffer_size", "restart_required": false, "type": "integer" }, { "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb", - "max": "1", - "min": "0", + "max": 1, + "min": 0, "name": "local_infile", "restart_required": false, "type": "integer" } ] } - diff --git a/trove/configuration/views.py b/trove/configuration/views.py index b02b6b442f..c2995ee7b9 100644 --- a/trove/configuration/views.py +++ b/trove/configuration/views.py @@ -127,9 +127,9 @@ class ConfigurationParameterView(object): "type": self.config.data_type, } if self.config.max_size: - ret["max"] = self.config.max_size + ret["max"] = int(self.config.max_size) if self.config.min_size: - ret["min"] = self.config.min_size + ret["min"] = int(self.config.min_size) return ret diff --git a/trove/tests/api/configurations.py b/trove/tests/api/configurations.py index 3aaa95c6a9..e4f2b210a0 100644 --- a/trove/tests/api/configurations.py +++ b/trove/tests/api/configurations.py @@ -222,8 +222,8 @@ class CreateConfigurations(ConfigurationsTestBase): with TypeCheck('ConfigurationParameter', param) as parameter: parameter.has_field('name', basestring) parameter.has_field('restart_required', bool) - parameter.has_field('max', basestring) - parameter.has_field('min', basestring) + parameter.has_field('max', int) + parameter.has_field('min', int) parameter.has_field('type', basestring) parameter.has_field('datastore_version_id', unicode)