common Package

gettextutils Module

gettext for openstack-common modules.

Usual usage in an openstack.common module:

from nova.openstack.common.gettextutils import _

importutils Module

Import related utilities and helper functions.

keystone.openstack.common.importutils.import_class(import_str)

Returns a class from a string including module and class

keystone.openstack.common.importutils.import_module(import_str)

Import a module.

keystone.openstack.common.importutils.import_object(import_str, *args, **kwargs)

Import a class and return an instance of it.

keystone.openstack.common.importutils.import_object_ns(name_space, import_str, *args, **kwargs)

Import a class and return an instance of it, first by trying to find the class in a default namespace, then failing back to a full path if not found in the default namespace.

jsonutils Module

policy Module

setup Module

Utilities with minimum-depends for use in setup.py

keystone.openstack.common.setup.canonicalize_emails(changelog, mapping)

Takes in a string and an email alias mapping and replaces all instances of the aliases in the string with their real email.

keystone.openstack.common.setup.generate_authors()

Create AUTHORS file using git commits.

keystone.openstack.common.setup.get_cmdclass()

Return dict of commands to run from setup.py.

keystone.openstack.common.setup.get_reqs_from_files(requirements_files)
keystone.openstack.common.setup.get_version(package_name, pre_version=None)

Get the version of the project. First, try getting it from PKG-INFO, if it exists. If it does, that means we’re in a distribution tarball or that install has happened. Otherwise, if there is no PKG-INFO file, pull the version from git.

We do not support setup.py version sanity in git archive tarballs, nor do we support packagers directly sucking our git repo into theirs. We expect that a source tarball be made from our git repo - or that if someone wants to make a source tarball from a fork of our repo with additional tags in it that they understand and desire the results of doing that.

keystone.openstack.common.setup.parse_mailmap(mailmap='.mailmap')
keystone.openstack.common.setup.parse_requirements(requirements_files=['requirements.txt', 'tools/pip-requires'])
keystone.openstack.common.setup.write_git_changelog()

Write a changelog based on the git changelog.

timeutils Module

version Module

Utilities for consuming the version from pkg_resources.

class keystone.openstack.common.version.VersionInfo(package)

Bases: object

cached_version_string(prefix='')

Generate an object which will expand in a string context to the results of version_string(). We do this so that don’t call into pkg_resources every time we start up a program when passing version information into the CONF constructor, but rather only do the calculation when and if a version is requested

canonical_version_string()

Return the short version minus any alpha/beta tags.

release_string()

Return the full version of the package including suffixes indicating VCS status.

version_string()

Return the short version minus any alpha/beta tags.

version_string_with_vcs()

Return the full version of the package including suffixes indicating VCS status.

Table Of Contents

This Page