mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
reuse already split output for filtering (#4310)
there is no need to call out.split('\n') multiple times (line 275 and 277)
This commit is contained in:
committed by
Matt Clay
parent
81e87cefd7
commit
9549883e78
@@ -274,7 +274,7 @@ def main():
|
|||||||
lines = out.split('\n')
|
lines = out.split('\n')
|
||||||
filt = globals().get(command + "_filter_output", None)
|
filt = globals().get(command + "_filter_output", None)
|
||||||
if filt:
|
if filt:
|
||||||
filtered_output = filter(filt, out.split('\n'))
|
filtered_output = filter(filt, lines)
|
||||||
if len(filtered_output):
|
if len(filtered_output):
|
||||||
changed = filtered_output
|
changed = filtered_output
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user