Commit 5cb423e3 authored by Tom Niget's avatar Tom Niget

Add Registry.close() function to properly clean up resources

parent 859f2a78
......@@ -155,6 +155,11 @@ class RegistryServer:
else:
self.newHMAC(0)
def close(self):
self.sock.close()
self.db.close()
self.ctl.close()
def getConfig(self, name, *default):
r, = next(self.db.execute(
"SELECT value FROM config WHERE name=?", (name,)), default)
......
......@@ -70,6 +70,7 @@ class TestRegistryServer(unittest.TestCase):
@classmethod
def tearDownClass(cls):
cls.server.close()
# remove database
for file in [cls.config.db, cls.config.ca, cls.config.key]:
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment