Fix superfluous-parens pylint warnings

Let's fix them and enable the pylint check.

TrivialFix

Change-Id: Ie6f2ed4af92d6aaac57d8ce1d3141ae5b771ff04
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
This commit is contained in:
Brian Haley committed 2026-06-24 01:18:02 -04:00
1 parent 230d219ddd
commit 056feb26f7
8 files changed
+9 -10

No files matched your search

-1
View File
@@ -32,7 +32,6 @@ disable=
consider-using-f-string,
invalid-name,
missing-docstring,
superfluous-parens,
# "R" Refactor recommendations
duplicate-code,
inconsistent-return-statements,
+2 -2
View File
@@ -30,9 +30,9 @@ UINT32_REGEX = (r'(0|[1-9]\d{0,8}|[1-3]\d{9}|4[01]\d{8}|42[0-8]\d{7}'
UINT16_REGEX = (r'(0|[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}'
r'|655[0-2]\d|6553[0-5])')
# Regular expression to validate 8 bits unsigned int
UINT8_REGEX = (r'(0|[1-9]\d{0,1}|1\d{2}|2[0-4]\d|25[0-5])')
UINT8_REGEX = r'(0|[1-9]\d{0,1}|1\d{2}|2[0-4]\d|25[0-5])'
# Regular expression to validate IPv4 address
IP4_REGEX = (rf'({UINT8_REGEX}\.{UINT8_REGEX}\.{UINT8_REGEX}\.{UINT8_REGEX})')
IP4_REGEX = rf'({UINT8_REGEX}\.{UINT8_REGEX}\.{UINT8_REGEX}\.{UINT8_REGEX})'
# Regular expression to validate Route Target list format
# Support of the Type 0, Type 1 and Type 2, cf. chapter 4.2 in RFC 4364
# Also validates Route Distinguisher list format
@@ -30,7 +30,7 @@ RESOURCE_NAME = 'minimum_packet_rate_rule'
COLLECTION_NAME = RESOURCE_NAME + 's'
NAME = 'QoS minimum packet rate rule'
API_PREFIX = '/' + qos_apidef.ALIAS
DESCRIPTION = ("Allow to configure QoS minimum packet rate rule.")
DESCRIPTION = "Allow to configure QoS minimum packet rate rule."
UPDATED_TIMESTAMP = '2021-07-14T10:00:00-00:00'
RESOURCE_ATTRIBUTE_MAP: ResourceAttributeMap = {}
SUB_RESOURCE_ATTRIBUTE_MAP: SubResourceAttributeMap = {
+1 -1
View File
@@ -262,7 +262,7 @@ def validate_values(data, valid_values=None, valid_values_display=None):
raise TypeError(msg) from e
else:
# This is a programming error
msg = (_("'valid_values' does not support membership operations"))
msg = _("'valid_values' does not support membership operations")
raise TypeError(msg)
+1 -1
View File
@@ -61,7 +61,7 @@ DEVICE_OWNER_AGENT_GW = (DEVICE_OWNER_NETWORK_PREFIX +
"floatingip_agent_gateway")
DEVICE_OWNER_ROUTER_SNAT = (DEVICE_OWNER_NETWORK_PREFIX +
"router_centralized_snat")
DEVICE_OWNER_ROUTED = (DEVICE_OWNER_NETWORK_PREFIX + "routed")
DEVICE_OWNER_ROUTED = DEVICE_OWNER_NETWORK_PREFIX + "routed"
DEVICE_OWNER_VPN_ROUTER_GW = (DEVICE_OWNER_NETWORK_PREFIX +
"vpn_router_gateway")
DEVICE_OWNER_VPN_TRANSIT_NETWORK = (DEVICE_OWNER_NETWORK_PREFIX +
+1 -1
View File
@@ -170,7 +170,7 @@ def query_with_hooks(context, model, field=None, lazy_fields=None):
query_filter = ((model.project_id == context.project_id) |
(model.shared == sql.true()))
else:
query_filter = (model.project_id == context.project_id)
query_filter = model.project_id == context.project_id
# Execute query hooks registered from mixins and plugins
for hook in get_hooks(model):
query_hook = helpers.resolve_ref(hook.get('query'))
+1 -1
View File
@@ -203,7 +203,7 @@ def model_query(context, model):
# define basic filter condition for model query
query_filter = None
if model_query_scope_is_project(context, model):
query_filter = (model.project_id == context.project_id)
query_filter = model.project_id == context.project_id
if query_filter is not None:
query = query.filter(query_filter)
+2 -2
View File
@@ -209,8 +209,8 @@ def resolve_ref(ref):
def timecost(f):
call_id = uuidutils.generate_uuid()
message_base = (f"Time-cost: call {call_id} function {f.__name__} ")
end_message = (message_base + "took %(seconds).3fs seconds to run")
message_base = f"Time-cost: call {call_id} function {f.__name__} "
end_message = message_base + "took %(seconds).3fs seconds to run"
@timeutils.time_it(LOG, message=end_message, min_duration=None)
def wrapper(*args, **kwargs):