Merge pull request #161 from oddstr13/pr-migrate-config-pr-145-1

Add config migration for pr #145
This commit is contained in:
mcarlton00 2019-12-13 19:58:50 -05:00 committed by GitHub
commit 51430d6aca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -392,6 +392,24 @@ def get_credentials():
credentials['Servers'] = credentials.get('Servers', []) credentials['Servers'] = credentials.get('Servers', [])
# Migration for #145
# TODO: CLEANUP for 1.0.0 release
for server in credentials['Servers']:
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']
# Functionality removed in #60
if 'RemoteAddress' in server:
del server['RemoteAddress']
elif 'LocalAddress' in server:
server['address'] = server['LocalAddress']
del server['LocalAddress']
if 'LastConnectionMode' in server:
del server['LastConnectionMode']
return credentials return credentials