Don't fail to write out services in the hostgroups databags

Fix the logic for checking for valid host groups
Merge pull request #141 from tas50/COOK-2558

COOK-2558: Don't fail to write out services in the hostgroups databags