def _getstatusoutput(args):
    """Execute bash command returning output and exit status."""
    import subprocess
    process = subprocess.Popen(args, executable='bash', shell=True, stderr=
        subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
    output = process.stdout.read().strip()
    status = process.wait()
    return status, output
