Example #1
0
  def delete_file(self, bucket, path):
    """Delete a single file within a GS bucket.

    TODO(epoger): what if bucket or path does not exist?  Should probably raise
    an exception.  Implement, and add a test to exercise this.

    Params:
      bucket: GS bucket to delete a file from
      path: full path (Posix-style) of the file within the bucket to delete
    """
    b = self._connect_to_bucket(bucket=bucket)
    key = Key(b)
    key.name = path
    try:
      key.delete()
    except BotoServerError, e:
      e.body = (repr(e.body) +
                ' while deleting gs://%s/%s' % (b.name, path))
      raise
Example #2
0
    def delete_file(self, bucket, path):
        """Delete a single file within a GS bucket.

    TODO(epoger): what if bucket or path does not exist?  Should probably raise
    an exception.  Implement, and add a test to exercise this.

    Params:
      bucket: GS bucket to delete a file from
      path: full path (Posix-style) of the file within the bucket to delete
    """
        b = self._connect_to_bucket(bucket=bucket)
        key = Key(b)
        key.name = path
        try:
            key.delete()
        except BotoServerError, e:
            e.body = (repr(e.body) + ' while deleting gs://%s/%s' %
                      (b.name, path))
            raise
Example #3
0
 def delete(self, package):
     path = self.get_path(package)
     key = Key(self.bucket)
     key.key = path
     key.delete()
Example #4
0
 def delete(self, package):
     path = self.get_path(package)
     key = Key(self.bucket)
     key.key = path
     key.delete()