diff --git a/tackerclient/common/_i18n.py b/tackerclient/common/_i18n.py index 2a9eeb4b..cd6a65b9 100644 --- a/tackerclient/common/_i18n.py +++ b/tackerclient/common/_i18n.py @@ -37,4 +37,4 @@ _P = _translators.plural_form def get_available_languages(): - return oslo_i18n.get_available_languages(DOMAIN) + return oslo_i18n.get_available_languages(DOMAIN) diff --git a/tackerclient/shell.py b/tackerclient/shell.py index 277c77ff..66b3b0ee 100644 --- a/tackerclient/shell.py +++ b/tackerclient/shell.py @@ -104,6 +104,7 @@ class BashCompletionCommand(openstack_command.OpenStackCommand): """Prints all of the commands and options for bash-completion.""" resource = "bash_completion" + COMMAND_V1 = { 'bash-completion': BashCompletionCommand, 'ext-list': extension.ListExt, diff --git a/tackerclient/tacker/v1_0/__init__.py b/tackerclient/tacker/v1_0/__init__.py index 4dbe01dd..e9cf4c87 100644 --- a/tackerclient/tacker/v1_0/__init__.py +++ b/tackerclient/tacker/v1_0/__init__.py @@ -164,9 +164,9 @@ def _process_previous_argument(current_arg, _value_number, current_type_str, values_specs): if current_arg is not None: if _value_number == 0 and (current_type_str or _list_flag): - # This kind of argument should have value - raise exceptions.CommandError( - _("Invalid values_specs %s") % ' '.join(values_specs)) + # This kind of argument should have value + raise exceptions.CommandError( + _("Invalid values_specs %s") % ' '.join(values_specs)) if _value_number > 1 or _list_flag or current_type_str == 'list': current_arg.update({'nargs': '+'}) elif _value_number == 0: diff --git a/tackerclient/tacker/v1_0/nfvo/ns.py b/tackerclient/tacker/v1_0/nfvo/ns.py index 6b167ffc..90dbd660 100644 --- a/tackerclient/tacker/v1_0/nfvo/ns.py +++ b/tackerclient/tacker/v1_0/nfvo/ns.py @@ -82,17 +82,17 @@ class CreateNS(tackerV10.CreateCommand): tacker_client = self.get_client() tacker_client.format = parsed_args.request_format if parsed_args.vim_name: - _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, - 'vim', - parsed_args. - vim_name) - parsed_args.vim_id = _id + _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, + 'vim', + parsed_args. + vim_name) + parsed_args.vim_id = _id if parsed_args.nsd_name: - _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, - 'nsd', - parsed_args. - nsd_name) - parsed_args.nsd_id = _id + _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, + 'nsd', + parsed_args. + nsd_name) + parsed_args.nsd_id = _id elif parsed_args.nsd_template: with open(parsed_args.nsd_template) as f: template = f.read() diff --git a/tackerclient/tacker/v1_0/vnfm/vnf.py b/tackerclient/tacker/v1_0/vnfm/vnf.py index 17fc095d..855acceb 100644 --- a/tackerclient/tacker/v1_0/vnfm/vnf.py +++ b/tackerclient/tacker/v1_0/vnfm/vnf.py @@ -105,17 +105,17 @@ class CreateVNF(tackerV10.CreateCommand): tacker_client = self.get_client() tacker_client.format = parsed_args.request_format if parsed_args.vim_name: - _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, - 'vim', - parsed_args. - vim_name) - parsed_args.vim_id = _id + _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, + 'vim', + parsed_args. + vim_name) + parsed_args.vim_id = _id if parsed_args.vnfd_name: - _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, - 'vnfd', - parsed_args. - vnfd_name) - parsed_args.vnfd_id = _id + _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, + 'vnfd', + parsed_args. + vnfd_name) + parsed_args.vnfd_id = _id elif parsed_args.vnfd_template: with open(parsed_args.vnfd_template) as f: template = f.read() diff --git a/tackerclient/tests/unit/osc/v1/test_vnf_package.py b/tackerclient/tests/unit/osc/v1/test_vnf_package.py index d9cf0b2f..5dc86a9b 100644 --- a/tackerclient/tests/unit/osc/v1/test_vnf_package.py +++ b/tackerclient/tests/unit/osc/v1/test_vnf_package.py @@ -181,15 +181,15 @@ class TestDeleteVnfPackage(TestVnfPackage): self._vnf_package = vnf_package_fakes.create_vnf_packages(count=3) def _mock_request_url_for_delete(self, vnf_pkg_index): - url = (self.url + '/vnfpkgm/v1/vnf_packages/' + - self._vnf_package['vnf_packages'][vnf_pkg_index]['id']) + url = (self.url + '/vnfpkgm/v1/vnf_packages/' + + self._vnf_package['vnf_packages'][vnf_pkg_index]['id']) - json = self._vnf_package['vnf_packages'][vnf_pkg_index] + json = self._vnf_package['vnf_packages'][vnf_pkg_index] - self.requests_mock.register_uri('GET', url, json=json, - headers=self.header) - self.requests_mock.register_uri('DELETE', url, - headers=self.header, json={}) + self.requests_mock.register_uri('GET', url, json=json, + headers=self.header) + self.requests_mock.register_uri('DELETE', url, + headers=self.header, json={}) def test_delete_one_vnf_package(self): arglist = [self._vnf_package['vnf_packages'][0]['id']] diff --git a/tackerclient/tests/unit/osc/v1/test_vnflcm.py b/tackerclient/tests/unit/osc/v1/test_vnflcm.py index bcb0d171..3a88f14a 100644 --- a/tackerclient/tests/unit/osc/v1/test_vnflcm.py +++ b/tackerclient/tests/unit/osc/v1/test_vnflcm.py @@ -484,15 +484,15 @@ class TestDeleteVnfLcm(TestVnfLcm): self.vnf_instances = vnflcm_fakes.create_vnf_instances(count=3) def _mock_request_url_for_delete(self, vnf_index): - url = os.path.join(self.url, 'vnflcm/v1/vnf_instances', - self.vnf_instances[vnf_index]['id']) + url = os.path.join(self.url, 'vnflcm/v1/vnf_instances', + self.vnf_instances[vnf_index]['id']) - json = self.vnf_instances[vnf_index] + json = self.vnf_instances[vnf_index] - self.requests_mock.register_uri('GET', url, json=json, - headers=self.header) - self.requests_mock.register_uri('DELETE', url, - headers=self.header, json={}) + self.requests_mock.register_uri('GET', url, json=json, + headers=self.header) + self.requests_mock.register_uri('DELETE', url, + headers=self.header, json={}) def test_delete_one_vnf_instance(self): arglist = [self.vnf_instances[0]['id']] diff --git a/test-requirements.txt b/test-requirements.txt index 07659205..0df150f0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 0fa782e6..25dfe8f4 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,8 @@ commands = [flake8] # E125 continuation line does not distinguish itself from next logical line -ignore = E125 +# W504 line break after binary operator +ignore = E125,W504 show-source = true exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools # F821 undefined name 'unicode'