mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
Don't delete the ejabberd backup database if it fails to load.
This commit is contained in:
parent
5bee775bc8
commit
b98a9ad84d
10
actions/xmpp
10
actions/xmpp
@ -168,9 +168,13 @@ def subcommand_change_hostname(arguments):
|
||||
|
||||
# load backup database
|
||||
if os.path.exists(EJABBERD_BACKUP):
|
||||
time.sleep(10)
|
||||
subprocess.call(['ejabberdctl', 'load', EJABBERD_BACKUP])
|
||||
os.remove(EJABBERD_BACKUP)
|
||||
try:
|
||||
subprocess.check_output(['ejabberdctl',
|
||||
'load',
|
||||
EJABBERD_BACKUP])
|
||||
os.remove(EJABBERD_BACKUP)
|
||||
except subprocess.CalledProcessError as err:
|
||||
print('Failed to load ejabberd backup database: %s', err)
|
||||
else:
|
||||
print('Could not load ejabberd backup database: %s not found'
|
||||
% EJABBERD_BACKUP)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user