Skip to content

Commit 6806521

Browse files
committed
Clean up acls
1 parent 0714c96 commit 6806521

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import uuid
66

77
import consulate
8+
from consulate import exceptions
89

910
with open('testing/consul.json', 'r') as handle:
1011
CONSUL_CONFIG = json.load(handle)
@@ -43,3 +44,12 @@ def tearDown(self):
4344
services = self.consul.agent.services()
4445
for name in services:
4546
self.consul.agent.service.deregister(services[name]['ID'])
47+
48+
for acl in self.consul.acl.list():
49+
if acl['ID'] == CONSUL_CONFIG['acl_master_token']:
50+
continue
51+
try:
52+
uuid.UUID(acl['ID'])
53+
self.consul.acl.destroy(acl['ID'])
54+
except (ValueError, exceptions.ConsulateException):
55+
pass

0 commit comments

Comments
 (0)