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 committed by Kiall Mac Innes
parent 160c17114b
commit 5203c5cb6c
4 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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