
import inspect
import os


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()


import pbr.version


__version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()

Fix --version to output version
Fix --version to output version

Change-Id: I7d8dc83ac7c2ad7519633d136c1c32ce8537dce8
Fixes: bug 1182675

  
+ import pbr.version
- import inspect
- import os
  
  
+ __version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()
- 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()
- 
Fix --version to output version
## Code Before:

import inspect
import os


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()

## Instruction:
Fix --version to output version
## Code After:

import pbr.version


__version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()
