'parses the inventory file'

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

    super(InventoryModule, self).parse(inventory, loader, path)
    try:
        data = self.loader.load_from_file(path)
    except Exception as e:
        raise AnsibleParserError(e)
    if (not data):
        return False
    if isinstance(data, dict):
        for group_name in data:
            self._parse_group(group_name, data[group_name])
    else:
        raise AnsibleParserError(('Invalid    data    from    file,    expected    dictionary    and    got:\n\n%s' % data))
