// ========================LICENSE_START=================================
// O-RAN-SC
// %%
-// Copyright (C) 2023: Nordix Foundation
+// Copyright (C) 2023: Nordix Foundation. All rights reserved.
+// Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
// %%
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
import (
"fmt"
- jsoniter "github.com/json-iterator/go"
- log "github.com/sirupsen/logrus"
"main/common/dataTypes"
"main/common/utils"
"main/components/kafkacollector"
"sync"
"syscall"
"time"
+
+ jsoniter "github.com/json-iterator/go"
+ log "github.com/sirupsen/logrus"
)
var ics_server = os.Getenv("ICS")
const registration_delay_short = 2
const registration_delay_long = 120
+const failedMessageLabel = " - failed"
+
//== Variables ==//
var AppState = Init
if err != nil {
log.Error("Cannot read config file: ", config_file)
// NOSONAR
- log.Error(registeringProducer, producer_instance_name, " - failed")
+ log.Error(registeringProducer, producer_instance_name, failedMessageLabel)
return false
}
data := dataTypes.DataTypes{}
if err != nil {
log.Error("Cannot parse config file: ", config_file)
// NOSONAR
- log.Error(registeringProducer, producer_instance_name, " - failed")
+ log.Error(registeringProducer, producer_instance_name, failedMessageLabel)
return false
}
var newTypeNames []string
if err != nil {
log.Error("Cannot create json for type: ", data.ProdDataTypes[i].ID)
// NOSONAR
- log.Error(registeringProducer, producer_instance_name, " - failed")
+ log.Error(registeringProducer, producer_instance_name, failedMessageLabel)
return false
} else {
ok := utils.SendHttpRequest(json, http.MethodPut, "http://"+ics_server+"/data-producer/v1/info-types/"+data.ProdDataTypes[i].ID, true, creds_grant_type != "")
if !ok {
log.Error("Cannot register type: ", data.ProdDataTypes[i].ID)
// NOSONAR
- log.Error(registeringProducer, producer_instance_name, " - failed")
+ log.Error(registeringProducer, producer_instance_name, failedMessageLabel)
return false
}
newTypeNames = append(newTypeNames, data.ProdDataTypes[i].ID)