Fix the broken neutron gate

There are currently two issues affecting the neutron gate, one
for pep8 job and the other for fullstack. We need to fix them
both together since they cannot merge separately.

Bump pylint to the latest version to fix pep8 job - it was
pinned to an old version which is causing the job to hang.

Do not use str(url) to stringify a URL for subsequent use
to fix  the fullstack job. The str(url) function in SQLAlchemy
hides the password. For a URL string that is to be re-used, use
render_as_string(hide_password=False).

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>

Closes-Bug: #2065779
Change-Id: I8d04db91ddc2995fbff05b4c4c48baebcc418522
This commit is contained in:
Takashi Kajinami 2024-05-15 00:12:22 +09:00 committed by Brian Haley
parent 35daa2d868
commit 11255ede97
8 changed files with 11 additions and 11 deletions

View File

@ -28,6 +28,7 @@ disable=
no-method-argument, no-method-argument,
no-self-argument, no-self-argument,
not-an-iterable, not-an-iterable,
possibly-used-before-assignment,
# "W" Warnings for stylistic problems or minor programming issues # "W" Warnings for stylistic problems or minor programming issues
abstract-method, abstract-method,
arguments-differ, arguments-differ,

View File

@ -1594,8 +1594,7 @@ class OVSFirewallDriver(firewall.FirewallDriver):
def _create_rules_generator_for_port(self, port): def _create_rules_generator_for_port(self, port):
for sec_group in port.sec_groups: for sec_group in port.sec_groups:
for rule in sec_group.raw_rules: yield from sec_group.raw_rules
yield rule
def _create_remote_rules_generator_for_port(self, port): def _create_remote_rules_generator_for_port(self, port):
for sec_group in port.sec_groups: for sec_group in port.sec_groups:

View File

@ -173,7 +173,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
experimental.validate_experimental_enabled( experimental.validate_experimental_enabled(
c_exp.EXPERIMENTAL_IPV6_PD) c_exp.EXPERIMENTAL_IPV6_PD)
except cfg.NoSuchOptError: except cfg.NoSuchOptError:
return pass
def __init__(self): def __init__(self):
self._validate_ipv6_pd() self._validate_ipv6_pd()

View File

@ -127,6 +127,7 @@ class RouterExtraAttributes(base.NeutronDbObject):
l3_attrs.RouterExtraAttributes.router_id). l3_attrs.RouterExtraAttributes.router_id).
join(l3.Router). join(l3.Router).
group_by(binding_model.router_id).subquery()) group_by(binding_model.router_id).subquery())
# pylint: disable=assignment-from-no-return
count = func.coalesce(sub_query.c.count, 0) count = func.coalesce(sub_query.c.count, 0)
query = (context.session.query(l3.Router, count). query = (context.session.query(l3.Router, count).
outerjoin(sub_query).join(l3_attrs.RouterExtraAttributes). outerjoin(sub_query).join(l3_attrs.RouterExtraAttributes).

View File

@ -85,12 +85,10 @@ class LocalVlanManager(object):
return key in self.mapping return key in self.mapping
def __iter__(self): def __iter__(self):
for value in list(self.mapping.values()): yield from list(self.mapping.values())
yield value
def items(self): def items(self):
for item in self.mapping.items(): yield from self.mapping.items()
yield item
def add(self, net_id, vlan, network_type, physical_network, def add(self, net_id, vlan, network_type, physical_network,
segmentation_id, vif_ports=None): segmentation_id, vif_ports=None):

View File

@ -378,8 +378,7 @@ class OVSFirewallLoggingDriver(log_ext.LoggingDriver):
) )
def create_rules_generator_for_port(self, port): def create_rules_generator_for_port(self, port):
for rule in port.secgroup_rules: yield from port.secgroup_rules
yield rule
def _create_conj_flows_log(self, remote_rule, port): def _create_conj_flows_log(self, remote_rule, port):
ethertype = remote_rule['ethertype'] ethertype = remote_rule['ethertype']

View File

@ -66,7 +66,9 @@ class BaseFullStackTestCase(testlib_api.MySQLTestCaseMixin,
# neutron server against this database. # neutron server against this database.
_orig_db_url = cfg.CONF.database.connection _orig_db_url = cfg.CONF.database.connection
cfg.CONF.set_override( cfg.CONF.set_override(
'connection', str(self.engine.url), group='database') 'connection',
self.engine.url.render_as_string(hide_password=False),
group='database')
self.addCleanup( self.addCleanup(
cfg.CONF.set_override, cfg.CONF.set_override,
"connection", _orig_db_url, group="database" "connection", _orig_db_url, group="database"

View File

@ -135,7 +135,7 @@ deps =
bashate>=2.1.1 # Apache-2.0 bashate>=2.1.1 # Apache-2.0
bandit>=1.7.5 # Apache-2.0 bandit>=1.7.5 # Apache-2.0
flake8-import-order>=0.18.2,<0.19.0 # LGPLv3 flake8-import-order>=0.18.2,<0.19.0 # LGPLv3
pylint==2.17.4 # GPLv2 pylint==3.2.0 # GPLv2
commands= commands=
# If it is easier to add a check via a shell script, consider adding it in this file # If it is easier to add a check via a shell script, consider adding it in this file
bash ./tools/misc-sanity-checks.sh bash ./tools/misc-sanity-checks.sh