parameters: (self, force=False)
docstring: Upload all pending files and then write the updated config to disk.
  
      Will attempt to copy files existing in the upload location to a backup
      location in the same bucket in cloud storage if |force| is True.
  
      Args:
        force: True if files should be uploaded to cloud storage even if a
            file already exists in the upload location.
  
      Raises:
        CloudStorageUploadConflictError: If |force| is False and the potential
            upload location of a file already exists.
        CloudStorageError: If copying an existing file to the backup location
            or uploading the new file fails.
docstring_summary: Upload all pending files and then write the updated config to disk.
docstring_tokens: Upload all pending files and then write the updated config to disk .
function: def Upload(self, force=False):
      """Upload all pending files and then write the updated config to disk.
  
      Will attempt to copy files existing in the upload location to a backup
      location in the same bucket in cloud storage if |force| is True.
  
      Args:
        force: True if files should be uploaded to cloud storage even if a
            file already exists in the upload location.
  
      Raises:
        CloudStorageUploadConflictError: If |force| is False and the potential
            upload location of a file already exists.
        CloudStorageError: If copying an existing file to the backup location
            or uploading the new file fails.
      """
      if cloud_storage.Exists(self._cs_bucket, self._cs_remote_path):
        if not force:
          #pylint: disable=nonstandard-exception
          raise exceptions.CloudStorageUploadConflictError(self._cs_bucket,
                                                           self._cs_remote_path)
          #pylint: enable=nonstandard-exception
        logging.debug('A file already exists at upload path %s in self.cs_bucket'
                      ' %s', self._cs_remote_path, self._cs_bucket)
        try:
          cloud_storage.Copy(self._cs_bucket, self._cs_bucket,
                             self._cs_remote_path, self._cs_backup_path)
          self._backed_up = True
        except cloud_storage.CloudStorageError:
          logging.error('Failed to copy existing file %s in cloud storage bucket '
                        '%s to backup location %s', self._cs_remote_path,
                        self._cs_bucket, self._cs_backup_path)
          raise
  
      try:
        cloud_storage.Insert(
            self._cs_bucket, self._cs_remote_path, self._local_path)
      except cloud_storage.CloudStorageError:
        logging.error('Failed to upload %s to %s in cloud_storage bucket %s',
                      self._local_path, self._cs_remote_path, self._cs_bucket)
        raise
      self._updated = True
function_tokens: def Upload ( self , force = False ) : if cloud_storage . Exists ( self . _cs_bucket , self . _cs_remote_path ) : if not force : #pylint: disable=nonstandard-exception raise exceptions . CloudStorageUploadConflictError ( self . _cs_bucket , self . _cs_remote_path ) #pylint: enable=nonstandard-exception logging . debug ( 'A file already exists at upload path %s in self.cs_bucket' ' %s' , self . _cs_remote_path , self . _cs_bucket ) try : cloud_storage . Copy ( self . _cs_bucket , self . _cs_bucket , self . _cs_remote_path , self . _cs_backup_path ) self . _backed_up = True except cloud_storage . CloudStorageError : logging . error ( 'Failed to copy existing file %s in cloud storage bucket ' '%s to backup location %s' , self . _cs_remote_path , self . _cs_bucket , self . _cs_backup_path ) raise try : cloud_storage . Insert ( self . _cs_bucket , self . _cs_remote_path , self . _local_path ) except cloud_storage . CloudStorageError : logging . error ( 'Failed to upload %s to %s in cloud_storage bucket %s' , self . _local_path , self . _cs_remote_path , self . _cs_bucket ) raise self . _updated = True