Skip to content
Snippets Groups Projects
Commit 8dae1216 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Improve error exit somewhat...

parent ce29b782
Branches
No related tags found
No related merge requests found
...@@ -26,6 +26,12 @@ def cond_kill(p): ...@@ -26,6 +26,12 @@ def cond_kill(p):
except: except:
pass pass
def cond_shutdown(s):
try:
s.shutdown(socket.SHUT_RDWR)
except:
pass
class Status: class Status:
def __init__(self, log): def __init__(self, log):
...@@ -182,6 +188,7 @@ def do_backup(hash_name, options, socket_path, mount, path): ...@@ -182,6 +188,7 @@ def do_backup(hash_name, options, socket_path, mount, path):
# Connect to server config/hashtoc socket # Connect to server config/hashtoc socket
config_hash = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) config_hash = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
atexit.register(cond_shutdown, config_hash, log)
config_hash.connect(socket_path) config_hash.connect(socket_path)
# Send secondary config to primary # Send secondary config to primary
config_hash.makefile('w').write(open(config_path).read()) config_hash.makefile('w').write(open(config_path).read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment