handlers: Remove 'notification.xml' when bucket is deleted. (#2389)

Do not pass around objectHandlers object, input argument
should comply to a type for only that would be used inside
the function body.
This commit is contained in:
Harshavardhana
2016-08-09 11:33:45 -07:00
committed by GitHub
parent e0cf4ee9fc
commit 82cd38e959
6 changed files with 47 additions and 33 deletions

View File

@@ -272,3 +272,14 @@ func (api objectAPIHandlers) ListenBucketNotificationHandler(w http.ResponseWrit
// Start sending bucket notifications.
sendBucketNotification(w, nEventCh)
}
// Removes notification.xml for a given bucket, only used during DeleteBucket.
func removeNotificationConfig(bucket string, objAPI ObjectLayer) error {
// Verify bucket is valid.
if !IsValidBucketName(bucket) {
return BucketNameInvalid{Bucket: bucket}
}
notificationConfigPath := path.Join(bucketConfigPrefix, bucket, bucketNotificationConfig)
return objAPI.DeleteObject(minioMetaBucket, notificationConfigPath)
}