[#1689] Remove deprecated NodeInfo.IterateAttributes()
Change-Id: Ibd07302079efe148903aa6177759232a28616736 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
bf06c4fb4b
commit
e65d578ba9
4 changed files with 8 additions and 8 deletions
|
@ -40,9 +40,9 @@ func (repl *policyPlaygroundREPL) handleLs(args []string) error {
|
||||||
i := 1
|
i := 1
|
||||||
for id, node := range repl.nodes {
|
for id, node := range repl.nodes {
|
||||||
var attrs []string
|
var attrs []string
|
||||||
node.IterateAttributes(func(k, v string) {
|
for k, v := range node.Attributes() {
|
||||||
attrs = append(attrs, fmt.Sprintf("%s:%q", k, v))
|
attrs = append(attrs, fmt.Sprintf("%s:%q", k, v))
|
||||||
})
|
}
|
||||||
fmt.Fprintf(repl.console, "\t%2d: id=%s attrs={%v}\n", i, id, strings.Join(attrs, " "))
|
fmt.Fprintf(repl.console, "\t%2d: id=%s attrs={%v}\n", i, id, strings.Join(attrs, " "))
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ func prettyPrintNodeInfo(cmd *cobra.Command, i netmap.NodeInfo) {
|
||||||
cmd.Println("address:", s)
|
cmd.Println("address:", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
i.IterateAttributes(func(key, value string) {
|
for key, value := range i.Attributes() {
|
||||||
cmd.Printf("attribute: %s=%s\n", key, value)
|
cmd.Printf("attribute: %s=%s\n", key, value)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ func PrettyPrintNodeInfo(cmd *cobra.Command, node netmap.NodeInfo,
|
||||||
cmd.Println()
|
cmd.Println()
|
||||||
|
|
||||||
if !short {
|
if !short {
|
||||||
node.IterateAttributes(func(key, value string) {
|
for key, value := range node.Attributes() {
|
||||||
cmd.Printf("%s\t%s: %s\n", indent, key, value)
|
cmd.Printf("%s\t%s: %s\n", indent, key, value)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,12 @@ func testAttributeMap(t *testing.T, mSrc, mExp map[string]string) {
|
||||||
mExp = mSrc
|
mExp = mSrc
|
||||||
}
|
}
|
||||||
|
|
||||||
node.IterateAttributes(func(key, value string) {
|
for key, value := range node.Attributes() {
|
||||||
v, ok := mExp[key]
|
v, ok := mExp[key]
|
||||||
require.True(t, ok)
|
require.True(t, ok)
|
||||||
require.Equal(t, value, v)
|
require.Equal(t, value, v)
|
||||||
delete(mExp, key)
|
delete(mExp, key)
|
||||||
})
|
}
|
||||||
|
|
||||||
require.Empty(t, mExp)
|
require.Empty(t, mExp)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue