Fix bug/1715127 kb_start_server fails on import error

https://bugs.launchpad.net/kloudbuster/+bug/1715127
Fix circular dependency between kloudbuster.py and kb_config.py by moving the version string to __init__.py

Change-Id: I973d6fa87653e26f5d0cc1661df7b7014b11a2f6
This commit is contained in:
ahothan 2017-09-05 08:39:57 -07:00
parent 8047c1fba3
commit 04552424c8
3 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,16 @@
# Copyright 2017 Cisco Systems, Inc. All rights reserved.
#
# 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__ = pbr.version.VersionInfo('kloudbuster').version_string_with_vcs()

View File

@ -16,13 +16,13 @@ import os
import sys
import yaml
from __init__ import __version__
from attrdict import AttrDict
import log as logging
from oslo_config import cfg
from pkg_resources import resource_string
import credentials
import kloudbuster
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@ -114,7 +114,7 @@ class KBConfig(object):
# Use the default image name for Glance
# defaults to something like "kloudbuster-7.0.0"
default_image_name = 'kloudbuster-' + kloudbuster.__version__
default_image_name = 'kloudbuster-' + __version__
if not self.config_scale['image_name']:
self.config_scale['image_name'] = default_image_name

View File

@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from __init__ import __version__
from concurrent.futures import ThreadPoolExecutor
import datetime
import json
@ -43,7 +45,6 @@ import log as logging
from neutronclient.neutron import client as neutronclient
from novaclient import client as novaclient
from oslo_config import cfg
import pbr.version
from pkg_resources import resource_filename
from pkg_resources import resource_string
from tabulate import tabulate
@ -51,8 +52,6 @@ import tenant
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
__version__ = pbr.version.VersionInfo('kloudbuster').version_string_with_vcs()
class KBVMCreationException(Exception):
pass