From e36b158ce79c01567fd97c950ff6bccd2c84ce0d Mon Sep 17 00:00:00 2001 From: is005q Date: Tue, 3 Dec 2019 13:37:29 +0200 Subject: [PATCH] [RICPLT-2523] Add GetE2TInstances | GetE2TAddresses Change-Id: Ice472dc1c95ffb2ac6762e59c1490f30df5bac6f Signed-off-by: is005q --- common/utils.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/common/utils.go b/common/utils.go index 608130e..d849021 100644 --- a/common/utils.go +++ b/common/utils.go @@ -91,8 +91,20 @@ func ValidateAndBuildRanLoadInformationKey(inventoryName string) (string, error) func ValidateAndBuildE2TInstanceKey(address string) (string, error) { if address == "" { - return "", NewValidationError("#utils.ValidateAndBuildRanLoadInformationKey - an empty inventory name received") + return "", NewValidationError("#utils.ValidateAndBuildE2TInstanceKey - an empty E2T address received") } return fmt.Sprintf("E2TInstance:%s", address), nil -} \ No newline at end of file +} + +func MapE2TAddressesToKeys(addresses []string) []string { + + keys := []string{} + for _, v := range addresses { + if len(v) != 0 { + keys = append(keys, fmt.Sprintf("E2TInstance:%s", v)) + } + } + + return keys +} -- 2.16.6