mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
NCLU Module: Improve performance by not operating on empty lines (#43024)
* Update nclu.py Stop module from running `net` on empty commands. * Update nclu.py Updated the copyright date * Update nclu.py Returned metadata version to 1.1 * Update nclu.py Fix indentation to be a multiple of 4. * Create changelog fragment
This commit is contained in:
parent
5d23406926
commit
dc42b43cd1
2 changed files with 5 additions and 2 deletions
2
changelogs/fragments/43024-nclu-empty-net-commands.yaml
Normal file
2
changelogs/fragments/43024-nclu-empty-net-commands.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- nclu - no longer runs net on empty lines in templates (https://github.com/ansible/ansible/pull/43024)
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# (c) 2016-2017, Cumulus Networks <ce-ceng@cumulusnetworks.com>
|
||||
# (c) 2016-2018, Cumulus Networks <ce-ceng@cumulusnetworks.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -185,6 +185,7 @@ def run_nclu(module, command_list, command_string, commit, atomic, abort, descri
|
|||
# Run all of the net commands
|
||||
output_lines = []
|
||||
for line in commands:
|
||||
if line.strip():
|
||||
output_lines += [command_helper(module, line.strip(), "Failed on line %s" % line)]
|
||||
output = "\n".join(output_lines)
|
||||
|
||||
|
|
Loading…
Reference in a new issue