From 9ddb096e8f985f3173e655da66452c1e4b68b7cd Mon Sep 17 00:00:00 2001 From: Brad Morrison Date: Fri, 5 Aug 2016 11:29:43 +1000 Subject: [PATCH] cmds.listServers: improve backend matching so that only exact matches are returned --- haproxy/cmds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haproxy/cmds.py b/haproxy/cmds.py index 80a9879..1af435b 100644 --- a/haproxy/cmds.py +++ b/haproxy/cmds.py @@ -194,9 +194,9 @@ def getResultObj(self, res): cols = self.getCols(res) for line in res.split('\n'): - if line.startswith(self.args['backend']): + if line.startswith(self.args['backend'] + ','): # Lines for server start with the name of the - # backend. + # backend immediately followed by a comma. outCols = line.split(',') if outCols[cols['svname']] != 'BACKEND':