parameters: (command)
return_statement: return proc.returncode
docstring: this just calls the command, and returns its return code,
      allowing stdout and stderr to work as normal. it is used
      as a fallback when environment variables or python
      dependencies cannot be configured, or when the logging
      webapp is unavailable, etc
docstring_summary: this just calls the command, and returns its return code,
      allowing stdout and stderr to work as normal. it is used
      as a fallback when environment variables or python
      dependencies cannot be configured, or when the logging
      webapp is unavailable, etc
docstring_tokens: this just calls the command and returns its return code allowing stdout and stderr to work as normal . it is used as a fallback when environment variables or python dependencies cannot be configured or when the logging webapp is unavailable etc
function: def run_and_echo(command):
      """
      this just calls the command, and returns its return code,
      allowing stdout and stderr to work as normal. it is used
      as a fallback when environment variables or python
      dependencies cannot be configured, or when the logging
      webapp is unavailable, etc
      """
      proc = subprocess.Popen(command)
  
      def handle_sigterm(signum, frame):
          try:
              proc.send_signal(signum)
          except AttributeError:
              os.kill(proc.pid, signum)
      orig_handler = signal.signal(signal.SIGTERM, handle_sigterm)
  
      proc.wait()
  
      signal.signal(signal.SIGTERM, orig_handler)
      return proc.returncode
function_tokens: def run_and_echo ( command ) : proc = subprocess . Popen ( command ) def handle_sigterm ( signum , frame ) : try : proc . send_signal ( signum ) except AttributeError : os . kill ( proc . pid , signum ) orig_handler = signal . signal ( signal . SIGTERM , handle_sigterm ) proc . wait ( ) signal . signal ( signal . SIGTERM , orig_handler ) return proc . returncode