1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-01 18:06:25 +00:00

xfconf: fix existing empty array case (#11026)

* xfconf: fix existing empty array case

* fix xfconf_info as well

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-11-03 08:20:31 +13:00 committed by GitHub
parent 9a7a316e24
commit b28ac655fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 4 deletions

View file

@ -209,8 +209,11 @@ class XFConfProperty(StateModuleHelper):
result = out.rstrip()
if "Value is an array with" in result:
result = result.split("\n")
result.pop(0)
result.pop(0)
if len(result) > 1:
result.pop(0)
result.pop(0)
else:
return []
return result

View file

@ -149,9 +149,12 @@ class XFConfInfo(ModuleHelper):
result = out.rstrip()
if "Value is an array with" in result:
result = result.split("\n")
result.pop(0)
result.pop(0)
self.vars.is_array = True
if len(result) > 1:
result.pop(0)
result.pop(0)
else:
return []
return result