aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-13 06:16:55 +0000
committerGerrit Code Review <review@openstack.org>2016-09-13 06:16:55 +0000
commit6e6894fcbd647c7df3c6c12722dedf977d41b40a (patch)
tree5e965aeaf9f6f1622089a1a9183f1d475004026d
parentbb3ed4ef5b295a45c402cdedf1dc18b24b3aa018 (diff)
parent253692630f156e81a7ea33d1fa9fc3708939a9c0 (diff)
downloadkolla-6e6894fcbd647c7df3c6c12722dedf977d41b40a.tar.gz
kolla-6e6894fcbd647c7df3c6c12722dedf977d41b40a.zip
Merge "Clean imports in code"
-rw-r--r--ansible/action_plugins/merge_configs.py8
-rwxr-xr-xansible/action_plugins/merge_yaml.py4
-rw-r--r--tests/test_keystone.py4
-rwxr-xr-xtools/version-check.py10
4 files changed, 13 insertions, 13 deletions
diff --git a/ansible/action_plugins/merge_configs.py b/ansible/action_plugins/merge_configs.py
index 266bc353e..821b4877d 100644
--- a/ansible/action_plugins/merge_configs.py
+++ b/ansible/action_plugins/merge_configs.py
@@ -14,15 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ConfigParser import ConfigParser
+import ConfigParser
import inspect
import os
from six import StringIO
-from ansible.plugins.action import ActionBase
+from ansible.plugins import action
-class ActionModule(ActionBase):
+class ActionModule(action.ActionBase):
TRANSFERS_FILES = True
@@ -62,7 +62,7 @@ class ActionModule(ActionBase):
temp_vars = task_vars.copy()
temp_vars.update(extra_vars)
- config = ConfigParser()
+ config = ConfigParser.ConfigParser()
old_vars = self._templar._available_variables
self._templar.set_available_variables(temp_vars)
diff --git a/ansible/action_plugins/merge_yaml.py b/ansible/action_plugins/merge_yaml.py
index 8eed1559e..76410833b 100755
--- a/ansible/action_plugins/merge_yaml.py
+++ b/ansible/action_plugins/merge_yaml.py
@@ -28,10 +28,10 @@ except ImportError:
from yaml import Loader # noqa: F401
-from ansible.plugins.action import ActionBase
+from ansible.plugins import action
-class ActionModule(ActionBase):
+class ActionModule(action.ActionBase):
TRANSFERS_FILES = True
diff --git a/tests/test_keystone.py b/tests/test_keystone.py
index 5145a2cfa..dbbba88ad 100644
--- a/tests/test_keystone.py
+++ b/tests/test_keystone.py
@@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from tests.clients import OpenStackClients
+from tests import clients
import testtools
@@ -19,7 +19,7 @@ import testtools
class KeystoneTest(testtools.TestCase):
def setUp(self):
super(KeystoneTest, self).setUp()
- self.kc = OpenStackClients().get_client('KeystoneClient')
+ self.kc = clients.OpenStackClients().get_client('KeystoneClient')
def test_tenants(self):
result = self.kc.tenants.list()
diff --git a/tools/version-check.py b/tools/version-check.py
index a20d14b79..9477762b0 100755
--- a/tools/version-check.py
+++ b/tools/version-check.py
@@ -18,10 +18,10 @@ import os
import re
import sys
-from bs4 import BeautifulSoup as bs
+import bs4
from oslo_config import cfg
import pkg_resources
-from prettytable import PrettyTable
+import prettytable
import requests
PROJECT_ROOT = os.path.abspath(os.path.join(
@@ -58,7 +58,7 @@ def retrieve_upstream_versions():
LOG.debug("Getting latest version for project %s from %s",
project, base)
r = requests.get(base)
- s = bs(r.text, 'html.parser')
+ s = bs4.BeautifulSoup(r.text, 'html.parser')
for link in s.find_all('a'):
version = link.get('href')
@@ -119,8 +119,8 @@ def diff_link(project, old_ref, new_ref):
def compare_versions():
up_to_date = True
- result = PrettyTable(["Project", "Current version",
- "Latest version", "Comparing changes"])
+ result = prettytable.PrettyTable(["Project", "Current version",
+ "Latest version", "Comparing changes"])
result.align = "l"
for project in VERSIONS['upstream']: