From 1eea14c63e9eb499f9216672fc7b2af1111399ea Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Fri, 31 Jan 2014 12:24:39 -0800 Subject: [PATCH] command/members: update for serf changes --- command/members.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/command/members.go b/command/members.go index 9373c8ad0a..46bd0915b7 100644 --- a/command/members.go +++ b/command/members.go @@ -87,13 +87,20 @@ func (c *MembersCommand) Run(args []string) int { for _, member := range members { // Skip the non-matching members - if !roleRe.MatchString(member.Role) || !statusRe.MatchString(member.Status) { + if !roleRe.MatchString(member.Tags["role"]) || !statusRe.MatchString(member.Status) { continue } + // Format the tags as tag1=v1,tag2=v2,... + var tagPairs []string + for name, value := range member.Tags { + tagPairs = append(tagPairs, fmt.Sprintf("%s=%s", name, value)) + } + tags := strings.Join(tagPairs, ",") + addr := net.TCPAddr{IP: member.Addr, Port: int(member.Port)} c.Ui.Output(fmt.Sprintf("%s %s %s %s", - member.Name, addr.String(), member.Status, member.Role)) + member.Name, addr.String(), member.Status, tags)) if detailed { c.Ui.Output(fmt.Sprintf(" Protocol Version: %d",