#NEWLINE# @ vm_util . Retry ( poll_interval = 1 , max_retries = 3 , retryable_exceptions = ( errors . VirtualMachine . RemoteCommandError , ) ) #NEWLINE# def RemoteCopy( self , file_path , remote_path = '' , copy_to = True ) : #NEWLINE# #INDENT# 'Copies a file to or from the container in the remote VM.\n\n    Args:\n      file_path: Local path to file.\n      remote_path: Optional path of where to copy file inside the container.\n      copy_to: True to copy to VM, False to copy from VM.\n    ' #NEWLINE# if copy_to : #NEWLINE# #INDENT# file_name = os . path . basename ( file_path ) #NEWLINE# tmp_path = posixpath . join ( vm_util . VM_TMP_DIR , file_name ) #NEWLINE# self . RemoteHostCopy ( file_path , tmp_path , copy_to ) #NEWLINE# self . ContainerCopy ( file_name , remote_path , copy_to ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# file_name = posixpath . basename ( remote_path ) #NEWLINE# tmp_path = posixpath . join ( vm_util . VM_TMP_DIR , file_name ) #NEWLINE# self . ContainerCopy ( file_path , remote_path , copy_to ) #NEWLINE# self . RemoteHostCopy ( file_path , tmp_path , copy_to )