Check against basestring instead of str in collect.hosts.