From df60f2cd334b6f9418f2a21d80f8a8a69592d9fa Mon Sep 17 00:00:00 2001 From: Yunhong Jiang Date: Mon, 9 Jun 2014 22:30:56 -0700 Subject: [PATCH] Fix doc for service list If a service is enabled, the "disabled_reason" field in response for /v2/.{tenant_id}./os-services/detail is null, however, currently it's specified as "" in the doc, thus may be confusing to users. This patch change the template and doc, it should not cause issue to existing applications. Change-Id: Ia71ec4c97a355bcc1a7b63e6107db77f80a5d843 Close-bug: 1328382 --- doc/api_samples/os-services/services-get-resp.json | 2 +- doc/api_samples/os-services/services-get-resp.xml | 2 +- doc/v3/api_samples/os-services/services-list-get-resp.json | 2 +- nova/tests/api/openstack/compute/contrib/test_services.py | 4 ++-- .../tests/api/openstack/compute/plugins/v3/test_services.py | 6 +++--- .../api_samples/os-services/services-get-resp.json.tpl | 2 +- .../api_samples/os-services/services-get-resp.xml.tpl | 2 +- .../api_samples/os-services/services-list-get-resp.json.tpl | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/api_samples/os-services/services-get-resp.json b/doc/api_samples/os-services/services-get-resp.json index 4c873d636b9c..b576ae8c9c63 100644 --- a/doc/api_samples/os-services/services-get-resp.json +++ b/doc/api_samples/os-services/services-get-resp.json @@ -25,7 +25,7 @@ "status": "enabled", "updated_at": "2012-09-19T06:55:34.000000", "zone": "internal", - "disabled_reason": "" + "disabled_reason": null }, { "binary": "nova-compute", diff --git a/doc/api_samples/os-services/services-get-resp.xml b/doc/api_samples/os-services/services-get-resp.xml index 6d42fce85cbc..f011bf7b1bb7 100644 --- a/doc/api_samples/os-services/services-get-resp.xml +++ b/doc/api_samples/os-services/services-get-resp.xml @@ -1,6 +1,6 @@ - + diff --git a/doc/v3/api_samples/os-services/services-list-get-resp.json b/doc/v3/api_samples/os-services/services-list-get-resp.json index 1b2c5bf3438b..ad3b86ae5d87 100644 --- a/doc/v3/api_samples/os-services/services-list-get-resp.json +++ b/doc/v3/api_samples/os-services/services-list-get-resp.json @@ -23,7 +23,7 @@ { "id": 3, "binary": "nova-scheduler", - "disabled_reason": "", + "disabled_reason": null, "host": "host2", "state": "down", "status": "enabled", diff --git a/nova/tests/api/openstack/compute/contrib/test_services.py b/nova/tests/api/openstack/compute/contrib/test_services.py index 577c37224d5d..b1587da4c9e2 100644 --- a/nova/tests/api/openstack/compute/contrib/test_services.py +++ b/nova/tests/api/openstack/compute/contrib/test_services.py @@ -61,7 +61,7 @@ fake_services_list = [ topic='scheduler', updated_at=datetime.datetime(2012, 9, 19, 6, 55, 34), created_at=datetime.datetime(2012, 9, 18, 2, 46, 28), - disabled_reason=''), + disabled_reason=None), dict(test_service.fake_service, binary='nova-compute', host='host2', @@ -278,7 +278,7 @@ class ServicesTest(test.TestCase): 'status': 'enabled', 'state': 'down', 'updated_at': datetime.datetime(2012, 9, 19, 6, 55, 34), - 'disabled_reason': ''}, + 'disabled_reason': None}, {'binary': 'nova-compute', 'host': 'host2', 'zone': 'nova', diff --git a/nova/tests/api/openstack/compute/plugins/v3/test_services.py b/nova/tests/api/openstack/compute/plugins/v3/test_services.py index 6b7ebb668793..4ed09b1ca211 100644 --- a/nova/tests/api/openstack/compute/plugins/v3/test_services.py +++ b/nova/tests/api/openstack/compute/plugins/v3/test_services.py @@ -59,7 +59,7 @@ fake_services_list = [ topic='scheduler', updated_at=datetime.datetime(2012, 9, 19, 6, 55, 34), created_at=datetime.datetime(2012, 9, 18, 2, 46, 28), - disabled_reason=''), + disabled_reason=None), dict(test_service.fake_service, binary='nova-compute', host='host2', @@ -194,7 +194,7 @@ class ServicesTest(test.TestCase): 'status': 'enabled', 'state': 'down', 'updated_at': datetime.datetime(2012, 9, 19, 6, 55, 34), - 'disabled_reason': ''}, + 'disabled_reason': None}, {'binary': 'nova-compute', 'host': 'host2', 'id': 4, @@ -437,7 +437,7 @@ class ServicesCellsTest(test.TestCase): 'state': 'down', 'updated_at': datetime.datetime(2012, 9, 19, 6, 55, 34, tzinfo=utc), - 'disabled_reason': ''}, + 'disabled_reason': None}, {'id': 'cell1@4', 'binary': 'nova-compute', 'host': 'host2', diff --git a/nova/tests/integrated/api_samples/os-services/services-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-services/services-get-resp.json.tpl index b3688c28f7a2..80be294dd68d 100644 --- a/nova/tests/integrated/api_samples/os-services/services-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-services/services-get-resp.json.tpl @@ -21,7 +21,7 @@ { "binary": "nova-scheduler", "host": "host2", - "disabled_reason": "", + "disabled_reason": null, "state": "down", "status": "enabled", "updated_at": "%(strtime)s", diff --git a/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl index ed8bb14dfc32..365f02e573d6 100644 --- a/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl @@ -2,6 +2,6 @@ - + diff --git a/nova/tests/integrated/v3/api_samples/os-services/services-list-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-services/services-list-get-resp.json.tpl index 7a5c586d5d93..174b443d0b15 100644 --- a/nova/tests/integrated/v3/api_samples/os-services/services-list-get-resp.json.tpl +++ b/nova/tests/integrated/v3/api_samples/os-services/services-list-get-resp.json.tpl @@ -22,7 +22,7 @@ }, { "binary": "nova-scheduler", - "disabled_reason": "", + "disabled_reason": null, "host": "host2", "id": 3, "state": "down",