From 54a9f59a1375cd7dc1ac7072681171964295b019 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 13 Sep 2016 23:30:40 +0530 Subject: [PATCH] Init: Print SQS ARNs after globalEventNotifier is inited. (#2682) fixes #2681 --- cmd/server-main.go | 3 +++ cmd/server-startup-msg.go | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cmd/server-main.go b/cmd/server-main.go index 7d5ea217f..4ff9088dc 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -416,6 +416,9 @@ func serverMain(c *cli.Context) { errorIf(err, "intializing object layer failed") return } + + printEventNotifiers() + objLayerMutex.Lock() globalObjectAPI = newObject objLayerMutex.Unlock() diff --git a/cmd/server-startup-msg.go b/cmd/server-startup-msg.go index d71158bef..b01d94b49 100644 --- a/cmd/server-startup-msg.go +++ b/cmd/server-startup-msg.go @@ -60,14 +60,25 @@ func printServerCommonMsg(endPoints []string) { console.Println(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKeyID))) console.Println(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretAccessKey))) console.Println(colorBlue("Region: ") + colorBold(fmt.Sprintf(getFormatStr(len(region), 3), region))) - arnMsg := colorBlue("SqsARNs: ") + + console.Println(colorBlue("\nBrowser Access:")) + console.Println(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr)) +} + +// Prints bucket notification configurations. +func printEventNotifiers() { + if globalEventNotifier == nil { + // In case initEventNotifier() was not done or failed. + return + } + arnMsg := colorBlue("\nSQS ARNs: ") + if len(globalEventNotifier.queueTargets) == 0 { + arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(""), 2), "")) + } for queueArn := range globalEventNotifier.queueTargets { arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(queueArn), 2), queueArn)) } console.Println(arnMsg) - - console.Println(colorBlue("\nBrowser Access:")) - console.Println(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr)) } // Prints startup message for command line access. Prints link to our documentation