mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user