Go to file
Monty Taylor f0c9b20e0f Handle UTC+00:00 in datetime strings
In some cases, the following:

  datetime.datetime.now(tz=iso8601.iso8601.UTC).tzinfo.tzname()

returns:

  'UTC+00:00'

rather than:

  'UTC'

resulting in strings that look like:

  2013-03-04T12:00:01.000000UTC+00:00

That is just flatly invalid. The code here accounts for a tzname of
"UTC" and normalizes to to being a trailing Z as-per the ISO 8601 spec,
but it does not account for UTC+00:00. Add support for that so that we
don't produce invalid date strings.

Most of this can be avoided by replacing use of this function with the
isoformat method of datetime instead.

  datetime.datetime.now(tz=iso8601.iso8601.UTC).isoformat()

Produces

  2013-03-04T12:00:01.000000+00:00

Which while different from

  2013-03-04T12:00:01.000000Z

is still a valid iso8601 string.

Change-Id: I52ca7561abee158285c2c98ba63d84c62e12360f
2017-12-02 11:15:26 -06:00
2016-12-21 12:59:13 +11:00
2014-05-07 12:12:43 -07:00
2015-02-13 17:55:34 +11:00
2012-09-29 16:03:23 -07:00
2011-10-25 16:50:08 -07:00
2017-03-22 22:27:35 +00:00

Team and repository tags

image

Python bindings to the OpenStack Identity API (Keystone)

Latest Version

Downloads

This is a client for the OpenStack Identity API, implemented by the Keystone team; it contains a Python API (the keystoneclient module) for OpenStack's Identity Service. For command line interface support, use OpenStackClient.

Contents:

Python API

By way of a quick-start:

>>> from keystoneauth1.identity import v3
>>> from keystoneauth1 import session
>>> from keystoneclient.v3 import client
>>> auth = v3.Password(auth_url="http://example.com:5000/v3", username="admin",
...                     password="password", project_name="admin",
...                     user_domain_id="default", project_domain_id="default")
>>> sess = session.Session(auth=auth)
>>> keystone = client.Client(session=sess)
>>> keystone.projects.list()
    [...]
>>> project = keystone.projects.create(name="test", description="My new Project!", domain="default", enabled=True)
>>> project.delete()
Description
OpenStack Identity (Keystone) Client
Readme 33 MiB
Languages
Python 100%