Merge "Clean imports in code"

This commit is contained in:
Jenkins 2017-08-08 16:30:44 +00:00 committed by Gerrit Code Review
commit 0cb2fa5f47
5 changed files with 17 additions and 18 deletions

View File

@ -1,4 +1,4 @@
from distutils.version import LooseVersion from distutils import version
from sphinx import __version__ as sphinx_version from sphinx import __version__ as sphinx_version
mypreamble=ur''' mypreamble=ur'''
@ -52,7 +52,7 @@ latex_elements = {
'fontpkg': '\usepackage[T1]{fontenc}' 'fontpkg': '\usepackage[T1]{fontenc}'
} }
if LooseVersion(sphinx_version) >= LooseVersion('1.3.1'): if version.LooseVersion(sphinx_version) >= version.LooseVersion('1.3.1'):
html_theme = "sphinx_rtd_theme" html_theme = "sphinx_rtd_theme"
html_add_permalinks = "" html_add_permalinks = ""

View File

@ -13,8 +13,8 @@ License for the specific language governing permissions and limitations
under the License. under the License.
""" """
from fuelweb_test import logwrap from fuelweb_test import logwrap
from keystoneauth1.identity.v2 import Password # TODO(otsvigun) v3 from keystoneauth1.identity import v2 # TODO(otsvigun) v3
from keystoneauth1.session import Session from keystoneauth1 import session
from fuelweb_test.settings import KEYSTONE_CREDS from fuelweb_test.settings import KEYSTONE_CREDS
from fuelweb_test.settings import PATH_TO_CERT from fuelweb_test.settings import PATH_TO_CERT
from fuelweb_test.settings import VERIFY_SSL from fuelweb_test.settings import VERIFY_SSL
@ -39,11 +39,11 @@ class ContrailClient(object):
controller_node_ip) controller_node_ip)
insecure = not VERIFY_SSL insecure = not VERIFY_SSL
credentials.update({'ca_cert': PATH_TO_CERT, 'insecure': insecure}) credentials.update({'ca_cert': PATH_TO_CERT, 'insecure': insecure})
auth = Password(auth_url=self.keystone_url, auth = v2.Password(auth_url=self.keystone_url,
username=KEYSTONE_CREDS['username'], username=KEYSTONE_CREDS['username'],
password=KEYSTONE_CREDS['password'], password=KEYSTONE_CREDS['password'],
tenant_name=KEYSTONE_CREDS['tenant_name']) tenant_name=KEYSTONE_CREDS['tenant_name'])
self._client = Session(auth=auth, verify=False) self._client = session.Session(auth=auth, verify=False)
@property @property
def client(self): def client(self):

View File

@ -22,7 +22,7 @@ from fuelweb_test.settings import HARDWARE
from fuelweb_test.helpers.checkers import check_repo_managment from fuelweb_test.helpers.checkers import check_repo_managment
import settings import settings
from tests.test_contrail_check import TestContrailCheck from tests import test_contrail_check
def assign_net_provider(obj, **options): def assign_net_provider(obj, **options):
@ -136,7 +136,7 @@ def update_deploy_check(obj, nodes, delete=False, is_vsrx=True,
ostf_params['failed_test_name'] = ostf_fail_tests ostf_params['failed_test_name'] = ostf_fail_tests
obj.fuel_web.run_ostf(cluster_id=obj.cluster_id, **ostf_params) obj.fuel_web.run_ostf(cluster_id=obj.cluster_id, **ostf_params)
TestContrailCheck(obj).cloud_check(['contrail']) test_contrail_check.TestContrailCheck(obj).cloud_check(['contrail'])
def wait_for_cluster_status(obj, cluster_id, def wait_for_cluster_status(obj, cluster_id,

View File

@ -17,11 +17,11 @@ import sys
import os import os
import re import re
from nose.plugins import Plugin from nose import plugins
from paramiko.transport import _join_lingering_threads from paramiko.transport import _join_lingering_threads
class CloseSSHConnectionsPlugin(Plugin): class CloseSSHConnectionsPlugin(plugins.Plugin):
"""Closes all paramiko's ssh connections after each test case. """Closes all paramiko's ssh connections after each test case.
Plugin fixes proboscis disability to run cleanup of any kind. Plugin fixes proboscis disability to run cleanup of any kind.

View File

@ -23,8 +23,7 @@ from proboscis.asserts import assert_equal
from fuelweb_test import logger from fuelweb_test import logger
from fuelweb_test.helpers.decorators import log_snapshot_after_test from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.settings import CONTRAIL_PLUGIN_PACK_UB_PATH from fuelweb_test.settings import CONTRAIL_PLUGIN_PACK_UB_PATH
from fuelweb_test.tests.base_test_case import SetupEnvironment from fuelweb_test.tests import base_test_case
from fuelweb_test.tests.base_test_case import TestBasic
from helpers import vsrx from helpers import vsrx
from helpers import plugin from helpers import plugin
from helpers import openstack from helpers import openstack
@ -34,7 +33,7 @@ from tests.test_contrail_check import TestContrailCheck
@test(groups=["plugins"]) @test(groups=["plugins"])
class FailoverTests(TestBasic): class FailoverTests(base_test_case.TestBasic):
"""FailoverTests.""" """FailoverTests."""
pack_copy_path = '/var/www/nailgun/plugins/contrail-5.1' pack_copy_path = '/var/www/nailgun/plugins/contrail-5.1'
@ -45,7 +44,7 @@ class FailoverTests(TestBasic):
pack_path = CONTRAIL_PLUGIN_PACK_UB_PATH pack_path = CONTRAIL_PLUGIN_PACK_UB_PATH
CONTRAIL_DISTRIBUTION = os.environ.get('CONTRAIL_DISTRIBUTION') CONTRAIL_DISTRIBUTION = os.environ.get('CONTRAIL_DISTRIBUTION')
@test(depends_on=[SetupEnvironment.prepare_slaves_3], @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_3],
groups=["contrail_uninstall", "contrail_failover"]) groups=["contrail_uninstall", "contrail_failover"])
@log_snapshot_after_test @log_snapshot_after_test
def contrail_uninstall(self): def contrail_uninstall(self):
@ -107,7 +106,7 @@ class FailoverTests(TestBasic):
"Plugin is not removed {}".format(plugin_name) "Plugin is not removed {}".format(plugin_name)
) )
@test(depends_on=[SetupEnvironment.prepare_slaves_9], @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_9],
groups=["contrail_ha_with_node_problems", "contrail_failover"]) groups=["contrail_ha_with_node_problems", "contrail_failover"])
@log_snapshot_after_test @log_snapshot_after_test
def contrail_ha_with_node_problems(self): def contrail_ha_with_node_problems(self):