Check groupnames for None as well as an empty string in add_host

Fixes #7585
This commit is contained in:
James Cammarata 2014-05-29 11:01:11 -05:00
parent 202ac68995
commit 188ab7b952

View file

@ -77,7 +77,7 @@ class ActionModule(object):
groupnames = args.get('groupname', args.get('groups', args.get('group', '')))
# add it to the group if that was specified
if groupnames != '':
if groupnames:
for group_name in groupnames.split(","):
group_name = group_name.strip()
if not inventory.get_group(group_name):