Run the provided command, logging details and checking for errors.

def run(cmd, descr=None, data=None, checks=None, region=None, log_error=True,
        log_stdout=False, env=None):
    """Run the provided command, logging details and checking for errors.
    """
    if descr:
      descr = _descr_str(descr, data, region)
      logger.debug(descr)
    cmd_id = diagnostics.start_cmd(cmd, descr or "", data)
    try:
        logger_cl.debug(" ".join(str(x) for x in cmd) if not isinstance(cmd, six.string_types) else cmd)
        _do_run(cmd, checks, log_stdout, env=env)
    except:
        diagnostics.end_cmd(cmd_id, False)
        if log_error:
            logger.exception()
        raise
    finally:
        diagnostics.end_cmd(cmd_id)