Merge "Fix --version to output version"
This commit is contained in:
@@ -13,23 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import inspect
|
import pbr.version
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def _get_client_version():
|
__version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()
|
||||||
"""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()
|
|
||||||
|
Reference in New Issue
Block a user