Pavel Loginov 2021-12-24 13:03:01 +06:00
parent 8c245968f6
commit 9c5b099ce5
1 changed files with 8 additions and 1 deletions

View File

@ -1010,8 +1010,15 @@ def upload_and_restart(server_ip, cfg, **kwargs):
# If master then save version of config in a new way # If master then save version of config in a new way
if not kwargs.get('slave'): if not kwargs.get('slave'):
diff = '' diff = ''
old_cfg = kwargs.get('oldcfg')
if kwargs.get('oldcfg') is None:
old_cfg = tmp_file + '.old'
try: try:
diff = diff_config(kwargs.get('oldcfg'), cfg, return_diff=1) get_config(server_ip, old_cfg)
except Exception:
logging('localhost', ' Cannot download config', haproxywi=1)
try:
diff = diff_config(old_cfg, cfg, return_diff=1)
except Exception as e: except Exception as e:
logging('localhost', str(e), haproxywi=1) logging('localhost', str(e), haproxywi=1)