mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #11115/58bb1e7c backport][stable-12] fix ruff case B007 (#11131)
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
(cherry picked from commit 58bb1e7c04)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user