zone_name is null in zone trasfer request response

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
This commit is contained in:
maestropandy 2016-06-28 18:51:08 +05:30
parent 424ebf3206
commit 9deeed706e
4 changed files with 9 additions and 0 deletions

View File

@ -88,6 +88,8 @@ class TransferRequestsController(rest.RestController):
except exceptions.EmptyRequestBody: except exceptions.EmptyRequestBody:
body = dict() body = dict()
zone = self.central_api.get_zone(context, zone_id)
body['zone_name'] = zone.name
body['zone_id'] = zone_id body['zone_id'] = zone_id
zone_transfer_request = DesignateAdapter.parse( zone_transfer_request = DesignateAdapter.parse(

View File

@ -49,6 +49,7 @@ class ZoneTransferRequestAPIv2Adapter(base.APIv2Adapter):
'protected': False 'protected': False
}, },
"zone_name": { "zone_name": {
'immutable': True,
'protected': False 'protected': False
}, },
"created_at": {}, "created_at": {},

View File

@ -42,6 +42,9 @@ class ApiV2ZoneTransfersTest(ApiV2TestCase):
self.assertIn('id', response.json) self.assertIn('id', response.json)
self.assertIn('created_at', response.json) self.assertIn('created_at', response.json)
self.assertEqual('ACTIVE', response.json['status']) self.assertEqual('ACTIVE', response.json['status'])
self.assertEqual(
self.zone.name,
response.json['zone_name'])
self.assertEqual( self.assertEqual(
self.zone.id, self.zone.id,
response.json['zone_id']) response.json['zone_id'])

View File

@ -0,0 +1,3 @@
---
fixes:
- Added zone_name in zone trasfer request response. Closed bug#1580014