summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaestropandy <maestropandy@gmail.com>2016-06-28 18:51:08 +0530
committerKiall Mac Innes <kiall@macinnes.ie>2016-10-28 12:52:22 +0000
commit5203c5cb6c8bdd59792890d815c355461d46aed6 (patch)
treef4e869ab3d1c45a051745037bd0038f4d1ed5761
parent160c17114b48275ab1ae87cd254a1c9662dce6cf (diff)
zone_name is null in zone trasfer request responsemitaka-eol2.1.0
The response to API call has zone_id set with zone id but zone name is set to 'null'. Change-Id: Id2d093891953efcbb125560ea1113b8a9e613a9c Closes-Bug: #1580014
Notes
Notes (review): Code-Review+2: Graham Hayes <graham.hayes@hpe.com> Code-Review+2: Tim Simmons <tim.simmons@rackspace.com> Workflow+1: Tim Simmons <tim.simmons@rackspace.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 01 Nov 2016 17:09:54 +0000 Reviewed-on: https://review.openstack.org/391460 Project: openstack/designate Branch: refs/heads/stable/mitaka
-rw-r--r--designate/api/v2/controllers/zones/tasks/transfer_requests.py2
-rw-r--r--designate/objects/adapters/api_v2/zone_transfer_request.py1
-rw-r--r--designate/tests/test_api/test_v2/test_zone_transfers.py3
-rw-r--r--releasenotes/notes/zone_name-null-zone-trasfer-request-response-a2e316872798d1df.yaml3
4 files changed, 9 insertions, 0 deletions
diff --git a/designate/api/v2/controllers/zones/tasks/transfer_requests.py b/designate/api/v2/controllers/zones/tasks/transfer_requests.py
index 3012338..eba70d0 100644
--- a/designate/api/v2/controllers/zones/tasks/transfer_requests.py
+++ b/designate/api/v2/controllers/zones/tasks/transfer_requests.py
@@ -75,6 +75,8 @@ class TransferRequestsController(rest.RestController):
75 except exceptions.EmptyRequestBody: 75 except exceptions.EmptyRequestBody:
76 body = dict() 76 body = dict()
77 77
78 zone = self.central_api.get_zone(context, zone_id)
79 body['zone_name'] = zone.name
78 body['zone_id'] = zone_id 80 body['zone_id'] = zone_id
79 81
80 zone_transfer_request = DesignateAdapter.parse( 82 zone_transfer_request = DesignateAdapter.parse(
diff --git a/designate/objects/adapters/api_v2/zone_transfer_request.py b/designate/objects/adapters/api_v2/zone_transfer_request.py
index e7ea939..7eaf8ad 100644
--- a/designate/objects/adapters/api_v2/zone_transfer_request.py
+++ b/designate/objects/adapters/api_v2/zone_transfer_request.py
@@ -49,6 +49,7 @@ class ZoneTransferRequestAPIv2Adapter(base.APIv2Adapter):
49 'protected': False 49 'protected': False
50 }, 50 },
51 "zone_name": { 51 "zone_name": {
52 'immutable': True,
52 'protected': False 53 'protected': False
53 }, 54 },
54 "created_at": {}, 55 "created_at": {},
diff --git a/designate/tests/test_api/test_v2/test_zone_transfers.py b/designate/tests/test_api/test_v2/test_zone_transfers.py
index 8b204e8..a42c1ff 100644
--- a/designate/tests/test_api/test_v2/test_zone_transfers.py
+++ b/designate/tests/test_api/test_v2/test_zone_transfers.py
@@ -42,6 +42,9 @@ class ApiV2ZoneTransfersTest(ApiV2TestCase):
42 self.assertIn('created_at', response.json) 42 self.assertIn('created_at', response.json)
43 self.assertEqual('ACTIVE', response.json['status']) 43 self.assertEqual('ACTIVE', response.json['status'])
44 self.assertEqual( 44 self.assertEqual(
45 self.zone.name,
46 response.json['zone_name'])
47 self.assertEqual(
45 self.zone.id, 48 self.zone.id,
46 response.json['zone_id']) 49 response.json['zone_id'])
47 self.assertIsNone(response.json['updated_at']) 50 self.assertIsNone(response.json['updated_at'])
diff --git a/releasenotes/notes/zone_name-null-zone-trasfer-request-response-a2e316872798d1df.yaml b/releasenotes/notes/zone_name-null-zone-trasfer-request-response-a2e316872798d1df.yaml
new file mode 100644
index 0000000..5e01545
--- /dev/null
+++ b/releasenotes/notes/zone_name-null-zone-trasfer-request-response-a2e316872798d1df.yaml
@@ -0,0 +1,3 @@
1---
2fixes:
3 - Added zone_name in zone trasfer request response. Closed bug#1580014