Skip to content

Commit

Permalink
Return empty list if a map doesn't have any entries
Browse files Browse the repository at this point in the history
If a map doesn't have entries haproxy returns an empty string.
Returning one element list with an empty string isn't the right approach.
Close #6
  • Loading branch information
Pavlos Parissis committed Apr 10, 2019
1 parent 68d2232 commit bc93ee6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion haproxyadmin/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,10 @@ def show_map(self, mapid=None):
if not check_output(map_info_proc1):
raise CommandFailed(map_info_proc1[0])

return map_info_proc1
if len(map_info_proc1) == 1 and not map_info_proc1[0]:
return []
else:
return map_info_proc1

@property
def uptime(self):
Expand Down

0 comments on commit bc93ee6

Please sign in to comment.