From 0a87fec6c6ee9255b5d841003d564eebc97ead2c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 13:13:42 +0300 Subject: [PATCH] [#316] ir/netmap: Rename LOCODE attribute key Rename key to LOCODE node attribute from `Locode` to `UN-LOCODE`. Signed-off-by: Leonard Lyubich --- .../processors/netmap/nodevalidation/locode/calls.go | 6 +++--- .../processors/netmap/nodevalidation/locode/validator.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/innerring/processors/netmap/nodevalidation/locode/calls.go b/pkg/innerring/processors/netmap/nodevalidation/locode/calls.go index 318a2cae..7b725ef5 100644 --- a/pkg/innerring/processors/netmap/nodevalidation/locode/calls.go +++ b/pkg/innerring/processors/netmap/nodevalidation/locode/calls.go @@ -10,10 +10,10 @@ var errMissingLocode = errors.New("missing locode attribute") var errMissingRequiredAttr = errors.New("missing required attribute in DB record") -// VerifyAndUpdate validates LOCODE attribute of n +// VerifyAndUpdate validates UN-LOCODE attribute of n // and adds a group of related attributes. // -// If n does not contain LOCODE attribute or its value does not +// If n does not contain UN-LOCODE attribute or its value does not // match the UN/LOCODE format, an error returns. // // New attributes are formed from the record of DB instance (Prm). @@ -26,7 +26,7 @@ var errMissingRequiredAttr = errors.New("missing required attribute in DB record // * SubDiv: R.SubDivName(); // * Continent: R.Continent().String(). // -// LOCODE attribute remains untouched. +// UN-LOCODE attribute remains untouched. func (v *Validator) VerifyAndUpdate(n *netmap.NodeInfo) error { mAttr := uniqueAttributes(n.Attributes()) diff --git a/pkg/innerring/processors/netmap/nodevalidation/locode/validator.go b/pkg/innerring/processors/netmap/nodevalidation/locode/validator.go index e25878c9..fcd80ff5 100644 --- a/pkg/innerring/processors/netmap/nodevalidation/locode/validator.go +++ b/pkg/innerring/processors/netmap/nodevalidation/locode/validator.go @@ -28,7 +28,7 @@ type Validator struct { // TODO: define constants in API lib. const ( - attrKeyLocode = "Locode" + attrKeyLocode = "UN-LOCODE" attrKeyCountryCode = "CountryCode" attrKeyCountry = "Country"