#NEWLINE# def ContainerCopy( self , file_name , container_path = '' , copy_to = True ) : #NEWLINE# #INDENT# "Copies a file to and from container_path to the host's vm_util.VM_TMP_DIR.\n\n    Args:\n      file_name: Name of the file in the host's vm_util.VM_TMP_DIR.\n      container_path: Optional path of where to copy file on container.\n      copy_to: True to copy to container, False to copy from container.\n    Raises:\n      RemoteExceptionError: If the source container_path is blank.\n    " #NEWLINE# if copy_to : #NEWLINE# #INDENT# if ( container_path == '' ) : #NEWLINE# #INDENT# container_path = CONTAINER_WORK_DIR #NEWLINE# #UNINDENT# source_path = posixpath . join ( CONTAINER_MOUNT_DIR , file_name ) #NEWLINE# command = ( 'cp %s %s' % ( source_path , container_path ) ) #NEWLINE# self . RemoteCommand ( command ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( container_path == '' ) : #NEWLINE# #INDENT# raise errors . VirtualMachine . RemoteExceptionError ( 'Cannot copy from blank target' ) #NEWLINE# #UNINDENT# destination_path = posixpath . join ( CONTAINER_MOUNT_DIR , file_name ) #NEWLINE# command = ( 'cp %s %s' % ( container_path , destination_path ) ) #NEWLINE# self . RemoteCommand ( source_path )