Ubuntu Pastebin

Paste from Colin Watson at Thu, 9 Jul 2015 13:33:06 +0000

Download as text
1
2
3
4
5
6
def get_output(command, expected_exit=[], *args, **kwargs):
    try:
        subprocess.check_output(command, *args, **kwargs)
    except subprocess.CalledProcessError as e:
        if e.returncode not in expected_exit:
            raise
Download as text