summaryrefslogtreecommitdiff
path: root/cinderclient/__init__.py
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-01-11 07:55:28 -0800
committerMonty Taylor <mordred@inaugust.com>2013-02-04 15:20:58 +1100
commit81cbbcc4e01c81084c352f7fc1ecea149089a2b9 (patch)
treefb48e96e05e98ccb88a1daa49685453d6f123262 /cinderclient/__init__.py
parentf0a6dee19f573d260f8028106e66842451f82e21 (diff)
downloadpython-cinderclient-81cbbcc4e01c81084c352f7fc1ecea149089a2b9.tar.gz
Update to latest oslo version code.
Removes the need for the versioninfo file, as now everything can be done via pkg_resources. Change-Id: Ice2ea2f99f5aacbd476075d12077b7287d824585
Diffstat (limited to 'cinderclient/__init__.py')
-rw-r--r--cinderclient/__init__.py29
1 files changed, 9 insertions, 20 deletions
diff --git a/cinderclient/__init__.py b/cinderclient/__init__.py
index 1f8ab19..6f6043c 100644
--- a/cinderclient/__init__.py
+++ b/cinderclient/__init__.py
@@ -14,23 +14,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-import os
-import inspect
-
-
-def _get_client_version():
- """Read version from versioninfo file."""
- mod_abspath = inspect.getabsfile(inspect.currentframe())
- client_path = os.path.dirname(mod_abspath)
- version_path = os.path.join(client_path, 'versioninfo')
-
- if os.path.exists(version_path):
- version = open(version_path).read().strip()
- else:
- version = "Unknown, couldn't find versioninfo file at %s"\
- % version_path
-
- return version
-
-
-__version__ = _get_client_version()
+from cinderclient.openstack.common import version
+
+version_info = version.VersionInfo('python-cinderclient')
+# We have a circular import problem when we first run python setup.py sdist
+# It's harmless, so deflect it.
+try:
+ __version__ = version_info.version_string()
+except AttributeError:
+ __version__ = None