
                         8    d Z ddlmZ ddlmZ ddlmZ d Zd Zy)z7Utilities for using containers in conjunction with ssh.    )absolute_import)division)unicode_literalsc                 >    | r|xs dg}|rdnd}ddd|| g|z   S |r|S y)a  Assemble the remote command list given user-supplied args.

  If a container argument is supplied, run
  `sudo docker exec -i[t] CONTAINER_ID COMMAND [ARGS...]` on the remote.

  Args:
    container: str or None, name of container to enter during connection.
    command: [str] or None, the remote command to execute. If no command is
      given, allocate a TTY.

  Returns:
    [str] or None, Remote command to run or None if no command.
  z/bin/shz-iz-itsudodockerexecN )	containercommandargsflagss       5lib/googlecloudsdk/command_lib/util/ssh/containers.pyGetRemoteCommandr      s=     !ykDDEHfeY7$>>N	    c                     | r|sdS dS )aG  Determine the ssh command should be run in a TTY or not.

  Args:
    container: str or None, name of container to enter during connection.
    command: [str] or None, the remote command to execute. If no command is
      given, allocate a TTY.

  Returns:
    Bool or None, whether to enforce TTY or not, or None if "auto".
  TNr
   )r   r   s     r   GetTtyr   0   s     744r   N)__doc__
__future__r   r   r   r   r   r
   r   r   <module>r      s     > '  '05r   