cloud-init/cloudinit/version.py
Joshua Harlow 911ada7bba Bring over the 'url_helper' module from bzr
This module is quite useful for fetching urls in a manner
that can be provided custom headers, retries and ssl_args
so let's ensure we have it available for usage under these
circumstances.

Also adds some basic sanity tests so that it will continue
to work as expected.

Change-Id: I4d5e777cf530e822bbea69c76846ebebb48a7927
2015-06-10 11:11:13 -07:00

15 lines
446 B
Python

# Copyright 2015 Canonical Ltd.
# This file is part of cloud-init. See LICENCE file for license information.
#
# vi: ts=4 expandtab
import pkg_resources
try:
from pbr import version as pbr_version
_version_info = pbr_version.VersionInfo('cloudinit')
version_string = _version_info.version_string
except ImportError:
_version_info = pkg_resources.get_distribution('cloudinit')
version_string = lambda: _version_info.version