Add migration for manual configuration servers

This commit is contained in:
mcarlton00 2019-12-13 19:38:20 -05:00 committed by GitHub
parent 039eea0aec
commit 842b0813a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -395,7 +395,13 @@ def get_credentials():
# Migration for #145 # Migration for #145
# TODO: CLEANUP for 1.0.0 release # TODO: CLEANUP for 1.0.0 release
for server in credentials['Servers']: for server in credentials['Servers']:
if 'LocalAddress' in server: if 'ManualAddress' in server:
server['address'] = server['ManualAddress']
del server['ManualAddress']
# If manual is present, local should always be here, but better to be safe
if 'LocalAddress' in server:
del server['LocalAddress']
elif 'LocalAddress' in server:
server['address'] = server['LocalAddress'] server['address'] = server['LocalAddress']
del server['LocalAddress'] del server['LocalAddress']
if 'LastConnectionMode' in server: if 'LastConnectionMode' in server: