def METHOD_NAME(vm):
  """Copies credential files to the specified VM.
  Args:
    vm: BaseVirtualMachine. VM that receives the credential files.
  Raises:
    errors.Error: If the file destination on the VM already exists, and the
        overwrite behavior is not specified via --aws_credentials_overwrite.
  """
  local_path = _GetLocalPath()
  remote_path = FLAGS.aws_credentials_remote_path
  overwrite = FLAGS.aws_credentials_overwrite
  try:
    vm.RemoteCommand('[[ ! -e {0} ]]'.format(remote_path))
  except errors.VirtualMachine.RemoteCommandError:
    err_msg = 'File {0} already exists on VM {1}.'.format(remote_path, vm)
    if overwrite:
      logging.info('%s Overwriting.', err_msg)
    else:
      raise errors.Error(err_msg)
  remote_dir = os.path.dirname(remote_path)
  if remote_dir:
    vm.RemoteCommand('mkdir -p {0}'.format(remote_dir))
  vm.PushFile(local_path, remote_path)