def run_cmd(cmd, return_output=False, ignore_status=False, log_output=True, **kwargs):
logger.debug('<STR_LIT>' % '<STR_LIT:U+0020>'.join(cmd))<EOL>process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,<EOL>universal_newlines=True, **kwargs)<EOL>output = process.communicate()[<NUM_LIT:0>]<EOL>if log_output:<EOL><INDENT>logger.debug(output)<EOL><DEDENT>if process.returncode > <NUM_LIT:0>:<EOL><INDENT>if ignore_status:<EOL><INDENT>if return_output:<EOL><INDENT>return output<EOL><DEDENT>else:<EOL><INDENT>return process.returncode<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise subprocess.CalledProcessError(cmd=cmd, returncode=process.returncode)<EOL><DEDENT><DEDENT>if return_output:<EOL><INDENT>return output<EOL><DEDENT>
run provided command on host system using the same user as you invoked this code, raises
subprocess.CalledProcessError if it fails

:param cmd: list of str
:param return_output: bool, return output of the command
:param ignore_status: bool, do not fail in case nonzero return code
:param log_output: bool, if True, log output to debug log
:param kwargs: pass keyword arguments to subprocess.check_* functions; for more info,
        please check `help(subprocess.Popen)`
:return: None or str