From 0ebabc50e4a48f0bc9f6aee71aaf148e337e2d6c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 22 Mar 2016 15:27:23 -0700 Subject: [PATCH] change name to be a list type remove implicit split that expects a , separated string, let list type deal with multiple possible compatible input types. also removed unused imports --- lib/ansible/modules/extras/packaging/os/pkgin.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/pkgin.py b/lib/ansible/modules/extras/packaging/os/pkgin.py index cdba6a9218..f75adf8299 100644 --- a/lib/ansible/modules/extras/packaging/os/pkgin.py +++ b/lib/ansible/modules/extras/packaging/os/pkgin.py @@ -63,10 +63,6 @@ EXAMPLES = ''' ''' -import shlex -import os -import sys -import pipes import re def query_package(module, pkgin_path, name): @@ -214,14 +210,14 @@ def main(): module = AnsibleModule( argument_spec = dict( state = dict(default="present", choices=["present","absent"]), - name = dict(aliases=["pkg"], required=True)), + name = dict(aliases=["pkg"], required=True, type='list')), supports_check_mode = True) pkgin_path = module.get_bin_path('pkgin', True, ['/opt/local/bin']) p = module.params - pkgs = p["name"].split(",") + pkgs = p["name"] if p["state"] == "present": install_packages(module, pkgin_path, pkgs)