def RunCommand(args, error_ok=False, error_message=None, shell=False, **kwargs):
    try:
        return subprocess2.check_output(args, shell=shell, **kwargs)
    except subprocess2.CalledProcessError as e:
        logging.debug('Failed running %s', args)
        if (not error_ok):
            DieWithError(('Command "%s" failed.\n%s' % (' '.join(args), (error_message or e.stdout or ''))))
        return e.stdout
def RunCommand(args, error_ok=False, error_message=None, shell=False, **kwargs):
    try:
        return subprocess2.check_output(args, shell=shell, **kwargs)
    except subprocess2.CalledProcessError as e:
        logging.debug('Failed running %s', args)
        if (not error_ok):
            DieWithError(('Command "%s" failed.\n%s' % (' '.join(args), (error_message or e.stdout or ))))
        return e.stdout