Alarm temp workaround 21/6221/1 alarm_workaround v0.8.2-1
authorMohamed Abukar <abukar.mohamed@nokia.com>
Thu, 3 Jun 2021 14:23:52 +0000 (14:23 +0000)
committerMohamed Abukar <abukar.mohamed@nokia.com>
Thu, 3 Jun 2021 14:23:58 +0000 (14:23 +0000)
Change-Id: I291dcdea1ad3204a1449e8196a306a86b7f28ea0
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
go.mod
go.sum
pkg/xapp/alarm.go [deleted file]
pkg/xapp/alarm_test.go [deleted file]
pkg/xapp/xapp.go

diff --git a/go.mod b/go.mod
index 20ae62a..7ab5a1c 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,6 @@ go 1.12
 
 require (
        gerrit.o-ran-sc.org/r/com/golog v0.0.2
-       gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0
        gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35
        gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35
        gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35
@@ -36,5 +35,3 @@ replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common => gerrit.o-ran-sc.o
 replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities => gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35
 
 replace gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader => gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35
-
-replace gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm => gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0
diff --git a/go.sum b/go.sum
index 04c9c4e..89033a9 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1,12 +1,6 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.0-20190604083303-aaffc8ebe3f1 h1:WAB8G/FFaUjRkpLuUhIo0EfbeBOY7xjkcFAFkpe3Xns=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.0-20190604083303-aaffc8ebe3f1/go.mod h1:b8YB31U8/4iRpABioeSzGi/YMzOQ/Zq7hrJmmXKqlJk=
 gerrit.o-ran-sc.org/r/com/golog.git v0.0.2 h1:Ix6SgFuzd6yW6Ur6+qDlGhDO65UYs8PiIkeAL1VaQ2o=
 gerrit.o-ran-sc.org/r/com/golog.git v0.0.2/go.mod h1:A7hUL52YQSO4dFIZNcj76XQ09C9PftAe3LyL7kqBnok=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2 h1:XNfkp3PwZ7pfkPszX7NaX6DzToCGjcWTLbIHYqCFNu0=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0 h1:OKDsIDlttbaoHwleyjflIWVZPgPvYbDhim6gWF0zf5E=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
 gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
 gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
 gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
diff --git a/pkg/xapp/alarm.go b/pkg/xapp/alarm.go
deleted file mode 100755 (executable)
index 0e6f637..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-==================================================================================
-  Copyright (c) 2020 AT&T Intellectual Property.
-  Copyright (c) 2020 Nokia
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================================
-*/
-
-package xapp
-
-import (
-       "gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm"
-       "os"
-)
-
-type AlarmClient struct {
-       alarmer *alarm.RICAlarm
-}
-
-// NewAlarmClient returns a new AlarmClient.
-func NewAlarmClient(moId, appId string) *AlarmClient {
-       if moId == "" {
-               moId = "RIC"
-               if hostname, err := os.Hostname(); err == nil {
-                       moId = hostname
-               }
-       }
-
-       if appId == "" {
-               appId = os.Args[0]
-       }
-
-       alarmInstance, err := alarm.InitAlarm(moId, appId)
-       if err == nil {
-               return &AlarmClient{
-                       alarmer: alarmInstance,
-               }
-       }
-       return nil
-}
-
-func (c *AlarmClient) Raise(sp int, severity alarm.Severity, identifyingInfo, additionalInfo string) error {
-       alarmData := c.alarmer.NewAlarm(sp, severity, identifyingInfo, additionalInfo)
-       return c.alarmer.Raise(alarmData)
-}
-
-func (c *AlarmClient) Clear(sp int, severity alarm.Severity, identifyingInfo, additionalInfo string) error {
-       alarmData := c.alarmer.NewAlarm(sp, severity, identifyingInfo, additionalInfo)
-       return c.alarmer.Clear(alarmData)
-}
-
-func (c *AlarmClient) Reraise(sp int, severity alarm.Severity, identifyingInfo, additionalInfo string) error {
-       alarmData := c.alarmer.NewAlarm(sp, severity, identifyingInfo, additionalInfo)
-       return c.alarmer.Reraise(alarmData)
-}
-
-func (c *AlarmClient) ClearAll() error {
-       return c.alarmer.ClearAll()
-}
diff --git a/pkg/xapp/alarm_test.go b/pkg/xapp/alarm_test.go
deleted file mode 100755 (executable)
index f8de8bd..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-==================================================================================
-  Copyright (c) 2019 AT&T Intellectual Property.
-  Copyright (c) 2019 Nokia
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================================
-*/
-
-package xapp
-
-import (
-       "github.com/stretchr/testify/assert"
-       "testing"
-
-       "gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm"
-)
-
-func TestNewAlarmClient(t *testing.T) {
-       Logger.Info("TestNewAlarmClient")
-
-       a := NewAlarmClient("", "")
-       assert.NotNil(t, a, "NewAlarmClient failed")
-}
-
-func TestAlarmRaise(t *testing.T) {
-       Logger.Info("TestAlarmRaise")
-
-       a := NewAlarmClient("", "")
-       assert.NotNil(t, a, "NewAlarmClient failed")
-
-       a.Raise(1234, alarm.SeverityCritical, "Some App data", "eth 0 1")
-}
-
-func TestAlarmClear(t *testing.T) {
-       Logger.Info("TestAlarmClear")
-
-       a := NewAlarmClient("", "")
-       assert.NotNil(t, a, "NewAlarmClient failed")
-
-       a.Clear(1234, alarm.SeverityCritical, "Some App data", "eth 0 1")
-}
-
-func TestAlarmReraise(t *testing.T) {
-       Logger.Info("TestAlarmReraise")
-
-       a := NewAlarmClient("", "")
-       assert.NotNil(t, a, "NewAlarmClient failed")
-
-       a.Reraise(1234, alarm.SeverityCritical, "Some App data", "eth 0 1")
-}
-
-func TestAlarmClearall(t *testing.T) {
-       Logger.Info("TestAlarmClearall")
-
-       a := NewAlarmClient("", "")
-       assert.NotNil(t, a, "NewAlarmClient failed")
-
-       a.ClearAll()
-}
index f778265..2f5f464 100755 (executable)
@@ -23,7 +23,6 @@ import (
        "bytes"
        "encoding/json"
        "fmt"
-       "github.com/spf13/viper"
        "net/http"
        "os"
        "os/signal"
@@ -31,6 +30,8 @@ import (
        "sync/atomic"
        "syscall"
        "time"
+
+       "github.com/spf13/viper"
 )
 
 type ReadyCB func(interface{})
@@ -46,7 +47,6 @@ var (
        Logger        *Log
        Config        Configurator
        Subscription  *Subscriber
-       Alarm         *AlarmClient
        Util          *Utils
        readyCb       ReadyCB
        readyCbParams interface{}
@@ -65,7 +65,6 @@ func SetReadyCB(cb ReadyCB, params interface{}) {
 }
 
 func XappReadyCb(params interface{}) {
-       Alarm = NewAlarmClient(viper.GetString("moId"), viper.GetString("name"))
        if readyCb != nil {
                readyCb(readyCbParams)
        }