diff --git a/os_cloud_config/cmd/setup_endpoints.py b/os_cloud_config/cmd/setup_endpoints.py index bf26150..8c537c8 100644 --- a/os_cloud_config/cmd/setup_endpoints.py +++ b/os_cloud_config/cmd/setup_endpoints.py @@ -13,9 +13,9 @@ import argparse import os -import simplejson import textwrap +import simplejson from os_cloud_config.cmd.utils import _clients from os_cloud_config.cmd.utils import environment diff --git a/os_cloud_config/cmd/tests/test_init_keystone.py b/os_cloud_config/cmd/tests/test_init_keystone.py index e5b3701..6dc1324 100644 --- a/os_cloud_config/cmd/tests/test_init_keystone.py +++ b/os_cloud_config/cmd/tests/test_init_keystone.py @@ -25,8 +25,8 @@ class InitKeystoneTest(base.TestCase): @mock.patch('os_cloud_config.cmd.init_keystone.initialize') @mock.patch.object(sys, 'argv', ['init-keystone', '-o', 'hostname', '-t', - 'token', '-e', 'admin@example.com', '-p', 'password', - '-u', 'root']) + 'token', '-e', 'admin@example.com', '-p', + 'password', '-u', 'root']) def test_script(self, initialize_mock): init_keystone.main() initialize_mock.assert_called_once_with( diff --git a/os_cloud_config/cmd/tests/test_setup_endpoints.py b/os_cloud_config/cmd/tests/test_setup_endpoints.py index bde81bc..f2c6eaa 100644 --- a/os_cloud_config/cmd/tests/test_setup_endpoints.py +++ b/os_cloud_config/cmd/tests/test_setup_endpoints.py @@ -11,9 +11,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import sys +import mock + from os_cloud_config.cmd import setup_endpoints from os_cloud_config.tests import base @@ -27,7 +28,8 @@ class SetupEndpointsTest(base.TestCase): sys, 'argv', ['setup-endpoints', '-s', '{"nova": {"password": "123"}}', '-p', '192.0.2.28', '-r', 'EC']) - @mock.patch.dict('os.environ', {'OS_USERNAME': 'admin', + @mock.patch.dict('os.environ', { + 'OS_USERNAME': 'admin', 'OS_PASSWORD': 'password', 'OS_TENANT_NAME': 'admin', 'OS_AUTH_URL': 'http://localhost:5000'}) diff --git a/os_cloud_config/keystone.py b/os_cloud_config/keystone.py index a00ed3e..2b0fd3b 100644 --- a/os_cloud_config/keystone.py +++ b/os_cloud_config/keystone.py @@ -15,12 +15,13 @@ from __future__ import print_function import logging -from six.moves.urllib.parse import urlparse import subprocess import time from keystoneclient.openstack.common.apiclient import exceptions import keystoneclient.v2_0.client as ksclient +from six.moves.urllib.parse import urlparse + from os_cloud_config.utils import clients LOG = logging.getLogger(__name__) diff --git a/os_cloud_config/nodes.py b/os_cloud_config/nodes.py index 07400dd..92bfc6e 100644 --- a/os_cloud_config/nodes.py +++ b/os_cloud_config/nodes.py @@ -18,9 +18,10 @@ import time from ironicclient.openstack.common.apiclient import exceptions as ironicexp from novaclient.openstack.common.apiclient import exceptions as novaexc -from os_cloud_config.cmd.utils import _clients as clients import six +from os_cloud_config.cmd.utils import _clients as clients + LOG = logging.getLogger(__name__) diff --git a/os_cloud_config/tests/__init__.py b/os_cloud_config/tests/__init__.py index 19f5e72..e69de29 100644 --- a/os_cloud_config/tests/__init__.py +++ b/os_cloud_config/tests/__init__.py @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- - -# 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. diff --git a/os_cloud_config/tests/test_keystone.py b/os_cloud_config/tests/test_keystone.py index 085c964..6f0014e 100644 --- a/os_cloud_config/tests/test_keystone.py +++ b/os_cloud_config/tests/test_keystone.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from keystoneclient.openstack.common.apiclient import exceptions import keystoneclient.v2_0.client as ksclient import mock -from keystoneclient.openstack.common.apiclient import exceptions from os_cloud_config import keystone from os_cloud_config.tests import base diff --git a/os_cloud_config/tests/test_nodes.py b/os_cloud_config/tests/test_nodes.py index 2aa6a3b..8312c74 100644 --- a/os_cloud_config/tests/test_nodes.py +++ b/os_cloud_config/tests/test_nodes.py @@ -15,11 +15,11 @@ import collections +from ironicclient.openstack.common.apiclient import exceptions as ironicexp import mock +from novaclient.openstack.common.apiclient import exceptions as novaexc from testtools import matchers -from ironicclient.openstack.common.apiclient import exceptions as ironicexp -from novaclient.openstack.common.apiclient import exceptions as novaexc from os_cloud_config import nodes from os_cloud_config.tests import base @@ -245,7 +245,7 @@ class NodesTest(base.TestCase): key['op'] = 'replace' self.assertThat(update_patch, matchers.MatchesSetwise(*(map(matchers.Equals, - args[1])))) + args[1])))) ironic.node.update.side_effect = side_effect nodes._update_or_register_ironic_node(None, node, node_map, client=ironic) @@ -298,7 +298,7 @@ class NodesTest(base.TestCase): key['op'] = 'replace' self.assertThat(update_patch, matchers.MatchesSetwise(*(map(matchers.Equals, - args[1])))) + args[1])))) ironic.node.update.side_effect = side_effect nodes._update_or_register_ironic_node(None, node, node_map, client=ironic) diff --git a/test-requirements.txt b/test-requirements.txt index 1ab545a..13291a1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=0.8.0,<0.9 +hacking>=0.9.2,<0.10 coverage>=3.6 discover