diff --git a/pkg/mcclient/modules/notify/mod_notification.go b/pkg/mcclient/modules/notify/mod_notification.go index a88c01fde4..ca48cdb52d 100644 --- a/pkg/mcclient/modules/notify/mod_notification.go +++ b/pkg/mcclient/modules/notify/mod_notification.go @@ -99,9 +99,3 @@ func (manager *NotificationManager) Send(s *mcclient.ClientSession, msg SNotifyM _, err := manager.Create(s, params) return err } - -func init() { - Notifications = NotificationManager{ - Notification, - } -} diff --git a/pkg/mcclient/modules/notify/mod_notify.go b/pkg/mcclient/modules/notify/mod_notify.go index 3d411bce22..17e353f7ee 100644 --- a/pkg/mcclient/modules/notify/mod_notify.go +++ b/pkg/mcclient/modules/notify/mod_notify.go @@ -90,4 +90,9 @@ func init() { []string{}, ) modules.Register(&NotifySubscriber) + + // important: Notifications' init must be behind Notication's init + Notifications = NotificationManager{ + Notification, + } }