Skip to content

Commit

Permalink
Update 'zone.dns_name' during 'zone.reload'.
Browse files Browse the repository at this point in the history
Closes #1720.
  • Loading branch information
tseaver committed Apr 19, 2016
1 parent 18a1af4 commit 660f8bb
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 660f8bb

Please sign in to comment.