def run_command(args, added_env=None, cwd=None):
    log.msg(
        format="Running %(args)r with environment %(env)r "
               "and working directory %(cwd)s",
        args=args, env=added_env, cwd=cwd)
    if added_env:
        env = os.environ.copy()
        env.update(env)
    else:
        env = None
    try:
        return check_output(args=args, env=env, cwd=cwd,)
    except CalledProcessError as e:
        print e.output
Run a subprocess and return its output. The command line and its
dataset/ETHPy150Open ClusterHQ/flocker/admin/packaging.py/run_command