def mkfs(device, label=None, ssize=None, noforce=None,
         bso=None, gmo=None, ino=None, lso=None, rso=None, nmo=None, dso=None):

    getopts = lambda args: dict(((args and ("=" in args)
                                  and args or None)) and [kw.split("=") for kw in args.split(",")] or [])
    cmd = ["mkfs.xfs"]
    if label:
        cmd.append("-L")
        cmd.append("'{0}'".format(label))

    if ssize:
        cmd.append("-s")
        cmd.append(ssize)

    for switch, opts in [("-b", bso), ("-m", gmo), ("-n", nmo), ("-i", ino),
                         ("-d", dso), ("-l", lso), ("-r", rso)]:
        try:
            if getopts(opts):
                cmd.append(switch)
                cmd.append(opts)
        except Exception:
            raise CommandExecutionError("Wrong parameters \"{0}\" for option \"{1}\"".format(opts, switch))

    if not noforce:
        cmd.append("-f")
    cmd.append(device)

    cmd = ' '.join(cmd)
    out = __salt__['cmd.run_all'](cmd)
    _verify_run(out, cmd=cmd)

    return _parse_xfs_info(out['stdout'])
The environment backing this buildstate.
dataset/ETHPy150Open saltstack/salt/salt/modules/xfs.py/mkfs--crossover with--dataset/ETHPy150Open lektor/lektor/lektor/builder.py/BuildState.env