'Find {group,host}_vars files'

def _find_vars_files(self, path, name):

    b_path = to_bytes(os.path.join(path, name))
    found = []
    if os.path.exists(b_path):
        if os.path.isdir(b_path):
            found.extend(self._get_dir_files(to_text(b_path)))
        else:
            found.append(b_path)
    else:
        for ext in C.YAML_FILENAME_EXTENSIONS:
            if ('.' in ext):
                full_path = (b_path + to_bytes(ext))
            elif ext:
                full_path = '.'.join([b_path, to_bytes(ext)])
            else:
                full_path = b_path
            if (os.path.exists(full_path) and os.path.isfile(full_path)):
                found.append(full_path)
                break
    return found
