add_group module: strip trailing/leading whitespace from comma-separated group names

This commit is contained in:
Tim Gerla 2013-10-17 14:13:55 -07:00
parent 8a516d1479
commit 51a1709253

View file

@ -79,6 +79,7 @@ class ActionModule(object):
# add it to the group if that was specified
if groupnames != '':
for group_name in groupnames.split(","):
group_name = group_name.strip()
if not inventory.get_group(group_name):
new_group = Group(group_name)
inventory.add_group(new_group)