def _run_cmd_async()

in cli/node_config_fetcher.py [0:0]


  def _run_cmd_async(self, cmd: str):
    """Runs a bash command and returns the output."""
    process = subprocess.Popen(
        cmd,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        shell=True,
    )
    stdout, stderr = process.communicate()
    if process.returncode != 0:
      raise subprocess.CalledProcessError(
          process.returncode, cmd, stderr, stdout
      )
    return stdout.decode('utf-8')