Browse Source

Merge "Clean imports in code"

Jenkins 1 year ago
parent
commit
0cb2fa5f47

+ 2
- 2
doc/source/conf.py View File

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

+ 7
- 7
plugin_test/helpers/contrail_client.py View File

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

+ 2
- 2
plugin_test/helpers/openstack.py View File

@@ -22,7 +22,7 @@ from fuelweb_test.settings import HARDWARE
22 22
 from fuelweb_test.helpers.checkers import check_repo_managment
23 23
 
24 24
 import settings
25
-from tests.test_contrail_check import TestContrailCheck
25
+from tests import test_contrail_check
26 26
 
27 27
 
28 28
 def assign_net_provider(obj, **options):
@@ -136,7 +136,7 @@ def update_deploy_check(obj, nodes, delete=False, is_vsrx=True,
136 136
             ostf_params['failed_test_name'] = ostf_fail_tests
137 137
         obj.fuel_web.run_ostf(cluster_id=obj.cluster_id, **ostf_params)
138 138
 
139
-        TestContrailCheck(obj).cloud_check(['contrail'])
139
+        test_contrail_check.TestContrailCheck(obj).cloud_check(['contrail'])
140 140
 
141 141
 
142 142
 def wait_for_cluster_status(obj, cluster_id,

+ 2
- 2
plugin_test/run_tests.py View File

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

+ 4
- 5
plugin_test/tests/test_failover.py View File

@@ -23,8 +23,7 @@ from proboscis.asserts import assert_equal
23 23
 from fuelweb_test import logger
24 24
 from fuelweb_test.helpers.decorators import log_snapshot_after_test
25 25
 from fuelweb_test.settings import CONTRAIL_PLUGIN_PACK_UB_PATH
26
-from fuelweb_test.tests.base_test_case import SetupEnvironment
27
-from fuelweb_test.tests.base_test_case import TestBasic
26
+from fuelweb_test.tests import base_test_case
28 27
 from helpers import vsrx
29 28
 from helpers import plugin
30 29
 from helpers import openstack
@@ -34,7 +33,7 @@ from tests.test_contrail_check import TestContrailCheck
34 33
 
35 34
 
36 35
 @test(groups=["plugins"])
37
-class FailoverTests(TestBasic):
36
+class FailoverTests(base_test_case.TestBasic):
38 37
     """FailoverTests."""
39 38
 
40 39
     pack_copy_path = '/var/www/nailgun/plugins/contrail-5.1'
@@ -45,7 +44,7 @@ class FailoverTests(TestBasic):
45 44
     pack_path = CONTRAIL_PLUGIN_PACK_UB_PATH
46 45
     CONTRAIL_DISTRIBUTION = os.environ.get('CONTRAIL_DISTRIBUTION')
47 46
 
48
-    @test(depends_on=[SetupEnvironment.prepare_slaves_3],
47
+    @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_3],
49 48
           groups=["contrail_uninstall", "contrail_failover"])
50 49
     @log_snapshot_after_test
51 50
     def contrail_uninstall(self):
@@ -107,7 +106,7 @@ class FailoverTests(TestBasic):
107 106
             "Plugin is not removed {}".format(plugin_name)
108 107
         )
109 108
 
110
-    @test(depends_on=[SetupEnvironment.prepare_slaves_9],
109
+    @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_9],
111 110
           groups=["contrail_ha_with_node_problems", "contrail_failover"])
112 111
     @log_snapshot_after_test
113 112
     def contrail_ha_with_node_problems(self):

Loading…
Cancel
Save