Move versioning into version.py

This commit is contained in:
Dan Prince 2014-09-04 09:59:11 -04:00
parent 262b7e48a4
commit a5d5450376
3 changed files with 21 additions and 8 deletions

View File

@ -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

View File

@ -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",

19
os_net_config/version.py Normal file
View File

@ -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')