update hacking and bandit

This patch updates hacking and bandit versions to match what neutron
and others are doing. It also fixes and ignores some pep8 errors
that crop up due to the version bump.

Change-Id: I99fa046475847400f8b0174c700d1b586766caa5
This commit is contained in:
Boden R 2019-05-30 10:47:10 -06:00 committed by Kobi Samoray
parent ef049d872f
commit e220ca0203
29 changed files with 107 additions and 94 deletions

View File

@ -1,4 +1,4 @@
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
mock>=2.0.0 # BSD

View File

@ -1,14 +1,15 @@
coverage==4.0
hacking==0.12.0
hacking>=1.1.0 # Apache-2.0
flake8-import-order==0.12
mock==2.0.0
neutron-lib==1.25.0
neutron-lib==1.26.0
openstackdocstheme==1.18.1
os-testr==1.0.0
oslotest==3.2.0
pbr==4.0.0
pylint==1.7.1
python-subunit==1.0.0
reno==2.5.0
Sphinx==1.6.5
stestr==2.0.0
tempest==17.1.0
testtools==2.2.0

View File

@ -3,4 +3,4 @@
# process, which may cause wedges in the gate later.
pbr>=4.0.0 # Apache-2.0
neutron-lib>=1.25.0 # Apache-2.0
neutron-lib>=1.26.0 # Apache-2.0

View File

@ -2,10 +2,12 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.13,>=0.12.0 # Apache-2.0
hacking>=1.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
flake8-import-order==0.12 # LGPLv3
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0
testtools>=2.2.0 # MIT
@ -13,4 +15,5 @@ testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
pylint==1.7.6 # GPLv2
stestr>=2.0.0 # Apache-2.0

View File

@ -82,7 +82,7 @@ commands = oslo_debug_helper {posargs}
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
import-order-style = pep8

View File

@ -12,12 +12,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import collections
import re
import netaddr
from oslo_log import log as logging
from oslo_utils import netutils
import re
from tempest import config
from tempest.lib.common.utils import data_utils

View File

@ -18,6 +18,7 @@ import shlex
import subprocess
import tempfile
import time
import urllib3
from oslo_log import log as logging

View File

@ -36,7 +36,7 @@ _opts = [
class VmwareNsxTempestPlugin(plugins.TempestPlugin):
"""Our addon configuration is defined at vmware_nsx_tempest_plugin/config.py
"""Our addon config is defined at vmware_nsx_tempest_plugin/config.py
1. register_opts() to register group/opts to Tempest
2. get_opt_lists() to pass config to Tempest

View File

@ -312,8 +312,8 @@ class VSMClient(object):
edges = self.get_all_edges()
edge_list = []
for e in edges:
if (not e['edgeStatus'] == 'GREY'
and not e['state'] == 'undeployed'):
if (not e['edgeStatus'] == 'GREY' and
not e['state'] == 'undeployed'):
p = re.compile(r'dhcp*')
if (p.match(e['name'])):
if version is not None and \

View File

@ -14,9 +14,10 @@
# under the License.
import json
import six
import time
import six
from oslo_log import log
from tempest import config
from tempest.lib.common import rest_client

View File

@ -57,8 +57,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0
vxlan_flag = 0
for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0
or vxlan_flag == 0):
if "transport_type" in tz.keys() and \
(vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id']
vxlan_flag = 1

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
import time
import testtools
from tempest.api.network import base
from tempest import config
from tempest.lib.common.utils import data_utils

View File

@ -39,8 +39,8 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest):
@classmethod
def create_network(cls, **kwargs):
"""Wrapper utility that returns a test admin provider network."""
network_name = (kwargs.get('net_name')
or data_utils.rand_name('test-adm-net-'))
network_name = (kwargs.get('net_name') or
data_utils.rand_name('test-adm-net-'))
net_type = kwargs.get('net_type', "flat")
if tempest.test.is_extension_enabled('provider', 'network'):
body = {'name': network_name}
@ -59,8 +59,8 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest):
"""Wrapper utility that returns a test subnet."""
# The cidr and mask_bits depend on the ip version.
if cls._ip_version == 4:
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr
or "192.168.101.0/24")
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr or
"192.168.101.0/24")
mask_bits = CONF.network.project_network_mask_bits or 24
elif cls._ip_version == 6:
cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr)

View File

@ -69,8 +69,8 @@ class TestDvsNetworkBasicOps(manager.NetworkScenarioTest):
def _create_subnet(self, network):
# The cidr and mask_bits depend on the ip version.
if self._ip_version == 4:
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr
or "192.168.101.0/24")
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr or
"192.168.101.0/24")
mask_bits = CONF.network.project_network_mask_bits or 24
elif self._ip_version == 6:
cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr)

View File

@ -530,7 +530,7 @@ class TestAdminPolicyBasicOps(dmgr.TopoDeployScenarioManager):
[self.fip_nasa_ames_1['floating_ip_address']])
def run_policy_BB_on_ames_BB_on_jpl(self):
### tenant jpl:policy_BB_GP, tenant ames:policy_BB_GP
# tenant jpl:policy_BB_GP, tenant ames:policy_BB_GP
self.log_exc_msg(
("Update tenant:ames to use policy_BB[%s] with group-ping"
% self.policy_BB))

View File

@ -62,8 +62,8 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
@classmethod
def skip_checks(cls):
super(TestDHCP121BasicOps, cls).skip_checks()
if not ((CONF.network.project_networks_reachable
or CONF.network.public_network_id) and
if not ((CONF.network.project_networks_reachable or
CONF.network.public_network_id) and
CONF.network.public_network_cidr):
msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.')
@ -458,10 +458,16 @@ class TestDhcpHostRoutesBetweenVms(TestDHCP121BasicOps):
client_mgr = self.manager
next_hop = CONF.network.project_network_cidr
ip = next_hop.rsplit('/', 1)[0]
ip2int = lambda ipstr: struct.unpack('!I', socket.inet_aton(ipstr))[0]
ss = (ip2int(ip))
int2ip = lambda n: socket.inet_ntoa(struct.pack('!I', n))
new_network_cidr = (int2ip(ss + 256))
def ip2int(ipstr):
return struct.unpack('!I', socket.inet_aton(ipstr))[0]
ss = ip2int(ip)
def int2ip(n):
return socket.inet_ntoa(struct.pack('!I', n))
new_network_cidr = int2ip(ss + 256)
net_mask = str(CONF.network.project_network_mask_bits)
new_network_cidr = new_network_cidr + '/' + net_mask
cidr = netaddr.IPNetwork(new_network_cidr)

View File

@ -47,8 +47,8 @@ class TestMultipleTransportZonesBasicOps(dmgr.TopoDeployScenarioManager):
@classmethod
def skip_checks(cls):
super(TestMultipleTransportZonesBasicOps, cls).skip_checks()
if not (CONF.network.project_networks_reachable
or CONF.network.public_network_id):
if not (CONF.network.project_networks_reachable or
CONF.network.public_network_id):
msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.')
raise cls.skipException(msg)

View File

@ -12,6 +12,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import time
from oslo_log import log as logging
from tempest import config
@ -23,8 +25,6 @@ from vmware_nsx_tempest_plugin.common import constants
from vmware_nsx_tempest_plugin.lib import feature_manager
from vmware_nsx_tempest_plugin.services import nsxv3_client
import time
CONF = config.CONF
CONF.validation.auth_method = 'None'

View File

@ -63,8 +63,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0
vxlan_flag = 0
for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0
or vxlan_flag == 0):
if "transport_type" in tz.keys() and (vlan_flag == 0 or
vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id']
vxlan_flag = 1

View File

@ -53,8 +53,8 @@ class TestMultiHVNetworkOps(manager.NetworkScenarioTest):
@classmethod
def skip_checks(cls):
super(TestMultiHVNetworkOps, cls).skip_checks()
if not (CONF.network.project_networks_reachable
or CONF.network.public_network_id):
if not (CONF.network.project_networks_reachable or
CONF.network.public_network_id):
msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.')
raise cls.skipException(msg)

View File

@ -817,8 +817,8 @@ class NetworkScenarioTest(ScenarioTest):
port_map = [(p["id"], fxip["ip_address"])
for p in ports
for fxip in p["fixed_ips"]
if netutils.is_valid_ipv4(fxip["ip_address"])
and p['status'] in p_status]
if netutils.is_valid_ipv4(fxip["ip_address"]) and
p['status'] in p_status]
inactive = [p for p in ports if p['status'] != 'ACTIVE']
if inactive:
LOG.warning("Instance has ports that are not ACTIVE: %s", inactive)

View File

@ -12,14 +12,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import dns.resolver
import subprocess
import time
from oslo_log import log as logging
import dns.resolver
from oslo_log import log as logging
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@ -65,8 +64,8 @@ class TestZonesV2Ops(feature_manager.FeatureManager):
vlan_flag = 0
vxlan_flag = 0
for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0
or vxlan_flag == 0):
if "transport_type" in tz.keys() and \
(vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id']
vxlan_flag = 1
@ -391,8 +390,8 @@ class TestZonesScenario(TestZonesV2Ops):
answer = my_resolver.query(record['name'])
except Exception:
LOG.error('ns lookup failed on ext-vm')
if (record['name'] not in answer.response.to_text()
or fip not in answer.response.to_text()):
if (record['name'] not in answer.response.to_text() or
fip not in answer.response.to_text()):
LOG.error('failed to resolve dns for the instance')
raise Exception('DNS response does not have entry '
'for the instance')

View File

@ -14,9 +14,10 @@
# under the License.
import re
import testtools
import time
import testtools
from oslo_utils import uuidutils
from tempest import config
from tempest.lib.common.utils import data_utils

View File

@ -56,8 +56,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0
vxlan_flag = 0
for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0
or vxlan_flag == 0):
if "transport_type" in tz.keys() and \
(vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id']
vxlan_flag = 1

View File

@ -12,12 +12,11 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import subprocess
import time
from oslo_log import log as logging
from subprocess import PIPE
from subprocess import Popen
from subprocess import STDOUT
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -26,8 +25,6 @@ from tempest import test
from vmware_nsx_tempest_plugin.lib import feature_manager
from vmware_nsx_tempest_plugin.services import nsx_client
import time
CONF = config.CONF
CONF.validation.auth_method = 'None'
@ -286,8 +283,9 @@ class TestQosOps(feature_manager.FeatureManager):
src_server=self.topology_servers["qos_src_vm"],
dst_server=self.topology_servers["qos_dst_vm"],
traffic_type='udp', send_dscp='0', interface='eth0')
"""Check the entire file to see if any UDP packets are sent without configured
dscp value.Example capture all UDP packets with DSCP value !=12"""
# Check the entire file to see if any UDP packets are sent without
# configured dscp value.Example capture all UDP packets with
# DSCP value !=12
src_vm_ip_dict = self.topology_servers['qos_src_vm']['floating_ips'][0]
filter_string = ('tshark -r %s -Y '
'\"ip.dsfield.dscp != %s && udp.dstport == 49162 '
@ -295,7 +293,8 @@ class TestQosOps(feature_manager.FeatureManager):
(dscp_filename, str(dscp_value),
src_vm_ip_dict['fixed_ip_address'],
self.topology_servers['qos_dst_vm']))
p = Popen(filter_string, shell=True, stdout=PIPE, stderr=STDOUT)
p = subprocess.Popen(filter_string, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = p.communicate()
LOG.info(stdout)
LOG.info(stderr)

View File

@ -77,7 +77,7 @@ class DHCPUnidimensionalScaleTest(feature_manager.FeatureManager):
self.assertIsNotNone(len(scale_switches), error_msg)
dhcp_servers = self.nsx.get_logical_dhcp_servers()
scale_dhcp_servers = [ds for ds in dhcp_servers
if ls['display_name'].startswith('uniscale-')]
if ds['display_name'].startswith('uniscale-')]
error_msg = ("Logical DHCP servers on backend doesn't match the "
"number of networks on OpenStack")
self.assertIsNotNone(len(scale_dhcp_servers), scale, error_msg)