From b8e732e52694e1a5ceb862485cd05ee451c31db6 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 5 Dec 2016 14:14:01 -0800 Subject: [PATCH] events: Fix the message printed by events{add,remove} (#1911) Fixes #1900 --- cmd/events-add.go | 15 ++++++++++++--- cmd/events-remove.go | 5 +++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cmd/events-add.go b/cmd/events-add.go index 271a594a..6bfe0dd3 100644 --- a/cmd/events-add.go +++ b/cmd/events-add.go @@ -75,7 +75,11 @@ func checkEventsAddSyntax(ctx *cli.Context) { // eventsAddMessage container type eventsAddMessage struct { - Status string `json:"status"` + ARN string `json:"arn"` + Events []string `json:"events"` + Prefix string `json:"prefix"` + Suffix string `json:"suffix"` + Status string `json:"status"` } // JSON jsonified update message. @@ -87,7 +91,7 @@ func (u eventsAddMessage) JSON() string { } func (u eventsAddMessage) String() string { - msg := console.Colorize("Events", "Successfully accomplished.") + msg := console.Colorize("Events", "Successfully added "+u.ARN) return msg } @@ -117,7 +121,12 @@ func mainEventsAdd(ctx *cli.Context) error { err = s3Client.AddNotificationConfig(arn, events, prefix, suffix) fatalIf(err, "Cannot enable notification on the specified bucket.") - printMsg(eventsAddMessage{}) + printMsg(eventsAddMessage{ + ARN: arn, + Events: events, + Prefix: prefix, + Suffix: suffix, + }) return nil } diff --git a/cmd/events-remove.go b/cmd/events-remove.go index 652ade7f..69108699 100644 --- a/cmd/events-remove.go +++ b/cmd/events-remove.go @@ -69,6 +69,7 @@ func checkEventsRemoveSyntax(ctx *cli.Context) { // eventsRemoveMessage container type eventsRemoveMessage struct { + ARN string `json:"arn"` Status string `json:"status"` } @@ -81,7 +82,7 @@ func (u eventsRemoveMessage) JSON() string { } func (u eventsRemoveMessage) String() string { - msg := console.Colorize("Events", "Successfully accomplished.") + msg := console.Colorize("Events", "Successfully removed "+u.ARN) return msg } @@ -111,7 +112,7 @@ func mainEventsRemove(ctx *cli.Context) error { err = s3Client.RemoveNotificationConfig(arn) fatalIf(err, "Cannot enable notification on the specified bucket.") - printMsg(eventsRemoveMessage{}) + printMsg(eventsRemoveMessage{ARN: arn}) return nil }