fix ruff case SIM103 (#11119)

* fix ruff case SIM103

* add changelog frag
This commit is contained in:
Alexei Znamensky
2025-11-13 09:12:47 +13:00
committed by GitHub
parent 58bb1e7c04
commit 41923e43bd
39 changed files with 115 additions and 230 deletions

View File

@@ -139,10 +139,7 @@ def is_valid_ip_prefix(ip_prefix):
ip_prefix_int = int(ip_prefix)
if ip_prefix_int < 0 or ip_prefix_int > 32:
return False
return True
return not (ip_prefix_int < 0 or ip_prefix_int > 32)
def ip_prefix_to_netmask(ip_prefix, skip_check=False):
@@ -243,10 +240,7 @@ def is_valid_ip6_prefix(ip6_prefix):
ip6_prefix_int = int(ip6_prefix)
if ip6_prefix_int < 0 or ip6_prefix_int > 128:
return False
return True
return not (ip6_prefix_int < 0 or ip6_prefix_int > 128)
def get_object_ref(module, name, uuid=None, obj_type="VM", fail=True, msg_prefix=""):