aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2014-09-04 09:59:11 -0400
committerDan Prince <dprince@redhat.com>2014-09-04 09:59:11 -0400
commita5d54503760d1100912c8ebba04708cf4ccf8a0e (patch)
tree8053d6c6de06017e0d60e53888d757c7d74fedda
parent262b7e48a4ef776b7880042ed33b98c6b3aaf5c8 (diff)
Move versioning into version.py
-rw-r--r--os_net_config/__init__.py6
-rw-r--r--os_net_config/cli.py4
-rw-r--r--os_net_config/version.py19
3 files changed, 21 insertions, 8 deletions
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')