fix ruff case B007 (#11115)

* fix ruff case B007

* rollback inventory/iocage

* re-do the fix in inventory/iocage

* add cases in tests/unit/plugins

* rollback plugins/module_utils/memset.py

* rollback extraneous changes in plugins/modules/xcc_redfish_command.py

* add changelog frag
This commit is contained in:
Alexei Znamensky
2025-11-13 09:06:14 +13:00
committed by GitHub
parent 40aea793ee
commit 58bb1e7c04
32 changed files with 90 additions and 73 deletions

View File

@@ -373,7 +373,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
ip_address_first = None
ipv6_address = None
ipv6_address_first = None
for iname, ivalue in interfaces.items():
for ivalue in interfaces.values():
# Set to first interface or management interface if defined or hostname matches dns_name
if ivalue["ip_address"] != "":
if ip_address_first is None:

View File

@@ -292,7 +292,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.get_jails(t_stdout, results)
if get_properties:
for hostname, host_vars in results["_meta"]["hostvars"].items():
for hostname in results["_meta"]["hostvars"]:
cmd_get_properties = cmd.copy()
cmd_get_properties.append(self.IOCAGE)
cmd_get_properties.append("get")
@@ -335,7 +335,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
except Exception as e:
raise AnsibleError(f"Failed to get pool: {e}") from e
for hostname, host_vars in results["_meta"]["hostvars"].items():
for hostname in results["_meta"]["hostvars"]:
iocage_hooks = []
for hook in hooks_results:
path = f"/{iocage_pool}/iocage/jails/{hostname}/root{hook}"