@ -157,6 +157,11 @@ stdout_lines:
returned : always apart from low level errors ( such as action plugin )
type : list
sample : [ [ ' ... ' , ' ... ' ] , [ ' ... ' ] , [ ' ... ' ] ]
output :
description : The set of transformed xml to json format from the commands responses
returned : If the I ( display ) is in C ( xml ) format .
type : list
sample : [ ' ... ' , ' ... ' ]
failed_conditions :
description : The list of conditionals that have failed
returned : failed
@ -348,7 +353,7 @@ def main():
responses = rpc ( module , items )
transformed = list ( )
output = list ( )
for item , resp in zip ( items , responses ) :
if item [ ' xattrs ' ] [ ' format ' ] == ' xml ' :
if not HAS_JXMLEASE :
@ -356,7 +361,9 @@ def main():
' It can be installed using `pip install jxmlease` ' )
try :
transformed . append ( jxmlease . parse ( resp ) )
json_resp = jxmlease . parse ( resp )
transformed . append ( json_resp )
output . append ( json_resp )
except :
raise ValueError ( resp )
else :
@ -390,6 +397,9 @@ def main():
' stdout_lines ' : to_lines ( responses )
}
if output :
result [ ' output ' ] = output
module . exit_json ( * * result )
if __name__ == ' __main__ ' :