Skip to content

Commit

Permalink
Merge pull request #1730 from tseaver/1720-update_zone_dns_name_in_re…
Browse files Browse the repository at this point in the history
…load

Update 'zone.dns_name' during 'zone.reload'.
  • Loading branch information
tseaver committed Apr 19, 2016
2 parents 18a1af4 + 660f8bb commit f498b06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gcloud/dns/test_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,12 @@ def test_reload_w_bound_client(self):
RESOURCE = self._makeResource()
conn = _Connection(RESOURCE)
client = _Client(project=self.PROJECT, connection=conn)
zone = self._makeOne(self.ZONE_NAME, self.DNS_NAME, client)
zone = self._makeOne(self.ZONE_NAME, client=client)

zone.reload()

self.assertEqual(zone.dns_name, self.DNS_NAME)

self.assertEqual(len(conn._requested), 1)
req = conn._requested[0]
self.assertEqual(req['method'], 'GET')
Expand Down
1 change: 1 addition & 0 deletions gcloud/dns/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def _set_properties(self, api_response):
"""
self._properties.clear()
cleaned = api_response.copy()
self.dns_name = cleaned.pop('dnsName', None)
if 'creationTime' in cleaned:
cleaned['creationTime'] = _rfc3339_to_datetime(
cleaned['creationTime'])
Expand Down

0 comments on commit f498b06

Please sign in to comment.