
                  	       ^    d Z ddlZddlmZmZ ddlmZ ddlmZ d
dee   dedeeef   fd	Z	y)z*General utility functions for diagnostics.    N)ListTuple)execution_utils)logargsin_strreturnc                    t        j                         }|j                  |        t        j                         }t        j                         }t        j
                  |d|j                  |j                  |      }|j                         }|j                         }t        j                  d|       t        j                  d|       |dk7  r|sd| }|dk(  r|nd|dk7  r|fS dfS )zRuns a gcloud command.

  Args:
    args: The arguments to pass to the gcloud command.
    in_str: The input to pass to the gcloud command.

  Returns:
    A tuple containing the stdout and stderr of the command.
  T)no_exitout_funcerr_funcr   z
stdout: %sz
stderr: %sr   zgcloud exited with return code N)
r   ArgsForGcloudextendioStringIOExecwritegetvaluer   debug)r   r   commandouterr
returncodestdoutstderrs           8lib/googlecloudsdk/command_lib/storage/diagnose/utils.py
run_gcloudr      s     ))+'	..
#
###yyyy* <<>&<<>&))L&!))L&!1_V.zl;FafTaf
 %)
     )N)
__doc__r   typingr   r   googlecloudsdk.corer   r   strr    r   r   <module>r$      s<    1 	  / #"T#Y " "uS#X "r   