From 9ab0a49ef2885a7ef216a92cf1bcabf3df1a305d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 1 Feb 2017 08:19:15 -0500 Subject: [PATCH] removes assert and uses to_list common function (#20866) non impacting change to refactor assert statement out of ios shared module --- lib/ansible/module_utils/ios.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py index 28930b5901..a449bc29bf 100644 --- a/lib/ansible/module_utils/ios.py +++ b/lib/ansible/module_utils/ios.py @@ -25,6 +25,7 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +from ansible.module_utils.network_common import to_list _DEVICE_CONFIGS = {} @@ -44,10 +45,8 @@ def get_config(module, flags=[]): return cfg def run_commands(module, commands, check_rc=True): - assert isinstance(commands, list), 'commands must be a list' responses = list() - - for cmd in commands: + for cmd in to_list(commands): rc, out, err = module.exec_command(cmd) if check_rc and rc != 0: module.fail_json(msg=err, rc=rc)