Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Change-Id: I7a43ff6d91bad919dcaa450e66ef492a1d3a03ef
This commit is contained in:
parent
1736ae7895
commit
d2f4c1748c
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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:
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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']]
|
||||
|
@ -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']]
|
||||
|
@ -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
|
||||
|
3
tox.ini
3
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'
|
||||
|
Loading…
Reference in New Issue
Block a user