diff options
author | Devaev Maxim <[email protected]> | 2019-04-06 19:53:30 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-04-06 21:59:15 +0300 |
commit | b8e3ceef6d2b7becb4b7bc8b39c9f852a465c90d (patch) | |
tree | 8ccd960d56995eaf97d0c213f52d43527f82cbf9 /kvmd | |
parent | 1d75b738a08c98a5d3d8ac3c685e77360f4c1267 (diff) |
better cleanup testing, remove all unix sockets
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/cleanup/__init__.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kvmd/apps/cleanup/__init__.py b/kvmd/apps/cleanup/__init__.py index 39bd7a71..632f258e 100644 --- a/kvmd/apps/cleanup/__init__.py +++ b/kvmd/apps/cleanup/__init__.py @@ -63,9 +63,15 @@ def main(argv: Optional[List[str]]=None) -> None: except subprocess.CalledProcessError: pass - unix_path = config.server.unix - if unix_path and os.path.exists(unix_path): - logger.info("Removing socket %r ...", unix_path) - os.remove(unix_path) + for (owner, unix_path) in [ + ("KVMD", config.server.unix), + ("streamer", config.streamer.unix), + ]: + if unix_path and os.path.exists(unix_path): + logger.info("Removing %s socket %r ...", owner, unix_path) + try: + os.remove(unix_path) + except Exception: + logger.exception("Can't remove %s socket %r", owner, unix_path) logger.info("Bye-bye") |