X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Frestendpoint.go;h=2e64f05162d6f2959af5f3872ad358908818ba12;hb=ff383bb22dcf671c68c543294556fe303feb27ff;hp=96df505375674de2e37092cfa3cd4117ce552c52;hpb=da34eecb23220659f8d519973c03d29444797998;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/restendpoint.go b/pkg/control/restendpoint.go index 96df505..2e64f05 100644 --- a/pkg/control/restendpoint.go +++ b/pkg/control/restendpoint.go @@ -31,6 +31,7 @@ import ( //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- + func ConstructEndpointAddresses(clientEndpoint models.SubscriptionParamsClientEndpoint) (string, string, error) { var HTTP_port int64 = *clientEndpoint.HTTPPort @@ -39,8 +40,13 @@ func ConstructEndpointAddresses(clientEndpoint models.SubscriptionParamsClientEn var xAppHTTPEndPoint string var xAppRMREndPoint string - if host == "" || (HTTP_port == 0 && RMR_port == 0) { - err := fmt.Errorf("ClientEndpoint aprovided no PORT numbers") + if host == "" { + err := fmt.Errorf("ClientEndpoint provided without HOST name") + return "", "", err + } + + if HTTP_port == 0 && RMR_port == 0 { + err := fmt.Errorf("ClientEndpoint provided without PORT numbers") return "INVALID_HTTP_ADDRESS:" + host + (string)(*clientEndpoint.HTTPPort), "INVALID_RMR_ADDRESS:" + host + (string)(*clientEndpoint.RMRPort), err