scripts/outputif
author Dan Minor <dminor@mozilla.com>
Fri, 18 Dec 2015 15:12:07 -0500
changeset 362083 2248273cff1c9789e941b14cb0a303dbfca0ff98
parent 360844 a454a3112d7c58f6b2613c6847c2112126d69c39
permissions -rwxr-xr-x
mozreview: people besides review requesters should be able autoland (bug 1205018) r=mdoglio This removes the check for whether or not the review is mutable by the current user, which allows people other than the review requester to autoland provided they have sufficient privileges.

#!/usr/bin/env python2
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# A script that executes its arguments as a new process and only
# prints its output if the executed command exited non-zero.

import subprocess
import sys

p = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE,
                     stderr=subprocess.STDOUT)
out, err = p.communicate()
ret = p.poll()
if ret:
    print(out)
    sys.exit(ret)

sys.exit(0)