'parses the inventory file'

def parse(self, inventory, loader, host_list, cache=True):

    super(InventoryModule, self).parse(inventory, loader, host_list)
    try:
        for h in host_list.split(','):
            h = h.strip()
            if h:
                try:
                    (host, port) = parse_address(h, allow_ranges=False)
                except AnsibleError as e:
                    self.display.vvv(('Unable    to    parse    address    from    hostname,    leaving    unchanged:    %s' % to_native(e)))
                    host = h
                    port = None
                if (host not in self.inventory.hosts):
                    self.inventory.add_host(host, group='ungrouped', port=port)
    except Exception as e:
        raise AnsibleParserError(('Invalid    data    from    string,    could    not    parse:    %s' % str(e)))
