Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS doesn't parse creationTime field #1362

Closed
kvdb opened this issue Jan 7, 2016 · 3 comments
Closed

DNS doesn't parse creationTime field #1362

kvdb opened this issue Jan 7, 2016 · 3 comments
Assignees
Labels
api: dns Issues related to the Cloud DNS API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kvdb
Copy link

kvdb commented Jan 7, 2016

I know DNS is not oficially supported yet, but I'm reporting it anyway. I'm using the master gcloud-python repo with this code:

client = dns.Client.from_service_account_json(                              
    'service-account.json', project='xyz-eu')           
zones = client.list_zones()                 

This is the error I get:

Traceback (most recent call last):
  ..
    zones = client.list_zones()
  File "/app/src/gcloud/gcloud/dns/client.py", line 94, in list_zones
    for resource in resp['managedZones']]
  File "/app/src/gcloud/gcloud/dns/zone.py", line 67, in from_api_repr
    zone._set_properties(resource)
  File "/app/src/gcloud/gcloud/dns/zone.py", line 218, in _set_properties
    cleaned['creationTime'] = float(cleaned['creationTime'])
ValueError: invalid literal for float(): 2015-04-02T13:21:24.943Z
@dhermes
Copy link
Contributor

dhermes commented Jan 7, 2016

Thanks for the report!

@dhermes dhermes added api: dns Issues related to the Cloud DNS API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 7, 2016
@dhermes
Copy link
Contributor

dhermes commented Jan 7, 2016

Will be "easy" to do once #1336 is in.

@dhermes
Copy link
Contributor

dhermes commented Jan 8, 2016

Verified from the docs: https://cloud.google.com/dns/api/v1/managedZones#resource

creationTime: The time that this resource was created on the server. This is in RFC3339 text format.

dhermes added a commit to dhermes/google-cloud-python that referenced this issue Jan 8, 2016
Was previously assumed to be a float (seconds from the epoch). Also
using core timestamp utilities in `dns` tests.

Fixes googleapis#1362.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dns Issues related to the Cloud DNS API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants