Skip to content

Commit 074ef69

Browse files
russozpatchback[bot]
authored andcommitted
fix ruff case E721 (#11121)
* fix ruff case E721 * add changelog frag (cherry picked from commit c45fba5)
1 parent cc93dab commit 074ef69

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- nmcli - fix comparison of type (https://github.com/ansible-collections/community.general/pull/11121).

plugins/modules/nmcli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ def show_connection(self):
24892489
if key and len(pair) > 1:
24902490
raw_value = pair[1].lstrip()
24912491
if raw_value == "--":
2492-
if key_type == list:
2492+
if key_type is list:
24932493
conn_info[key] = []
24942494
else:
24952495
conn_info[key] = None
@@ -2504,7 +2504,7 @@ def show_connection(self):
25042504
conn_info[alias_key] = alias_value
25052505
elif key in ("ipv4.routes", "ipv6.routes"):
25062506
conn_info[key] = [s.strip() for s in raw_value.split(";")]
2507-
elif key_type == list:
2507+
elif key_type is list:
25082508
conn_info[key] = [s.strip() for s in raw_value.split(",")]
25092509
else:
25102510
m_enum = p_enum_value.match(raw_value)

ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ ignore = [
2121
"B905", # zip-without-explicit-strict - needs Python 3.10+
2222
"UP045", # Use `X | None` for type annotations - needs Python 3.10+
2323
# To fix:
24-
"E721", # Type comparison
2524
"UP014", # Convert `xxx` from `NamedTuple` functional to class syntax
2625
"UP024", # Replace aliased errors with `OSError`
2726
"UP028", # Replace `yield` over `for` loop with `yield from`

0 commit comments

Comments
 (0)