From a5d54503760d1100912c8ebba04708cf4ccf8a0e Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 4 Sep 2014 09:59:11 -0400 Subject: Move versioning into version.py --- os_net_config/__init__.py | 6 ------ os_net_config/cli.py | 4 ++-- os_net_config/version.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 os_net_config/version.py (limited to 'os_net_config') diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py index 30baac1..484c1e4 100644 --- a/os_net_config/__init__.py +++ b/os_net_config/__init__.py @@ -14,14 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -import pbr.version - - from os_net_config import objects -__version__ = pbr.version.VersionInfo( - 'os_net_config').version_string() - class NotImplemented(Exception): pass diff --git a/os_net_config/cli.py b/os_net_config/cli.py index e919d02..85599db 100644 --- a/os_net_config/cli.py +++ b/os_net_config/cli.py @@ -21,11 +21,11 @@ import os import sys import yaml -import os_net_config from os_net_config import impl_eni from os_net_config import impl_ifcfg from os_net_config import impl_iproute from os_net_config import objects +from os_net_config import version logger = logging.getLogger(__name__) @@ -56,7 +56,7 @@ def parse_opts(argv): required=False) parser.add_argument('--version', action='version', - version=os_net_config.__version__) + version=version.version_info.version_string()) parser.add_argument( '--noop', dest="noop", diff --git a/os_net_config/version.py b/os_net_config/version.py new file mode 100644 index 0000000..2af627c --- /dev/null +++ b/os_net_config/version.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2014 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import pbr.version + +version_info = pbr.version.VersionInfo('os-net-config') -- cgit 1.2.3-korg