def file_list(*packages):
    errors = []
    ret = []
    cmd = ['pacman', '-Ql']

    if len(packages) > 0 and os.path.exists(packages[0]):
        packages = list(packages)
        cmd.extend(('-r', packages.pop(0)))

    cmd.extend(packages)

    out = __salt__['cmd.run'](cmd, output_loglevel='trace', python_shell=False)
    for line in salt.utils.itertools.split(out, '\n'):
        if line.startswith('error'):
            errors.append(line)
        else:
            comps = line.split()
            ret.append(' '.join(comps[1:]))
    return {'errors': errors, 'files': ret}
Verify master IP is reachable.
dataset/ETHPy150Open saltstack/salt/salt/modules/pacman.py/file_list--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/backend.py/VerifyMasterIP