Unify network devices and addresses in config

The old way of doing this was a little cumbersome, with an upper YAML
tree split between "devices" (name and MTU) and addresses. This commit
unifies these under the root "networking" section to make this section
clearer.
This commit is contained in:
2019-06-17 23:41:07 -04:00
parent e70255dbd6
commit 1d3f868206
2 changed files with 33 additions and 37 deletions

View File

@ -179,15 +179,15 @@ def readConfig(pvcd_config_file, myhostname):
'pdns_postgresql_dbname': o_config['pvc']['coordinator']['dns']['database']['name'],
'pdns_postgresql_user': o_config['pvc']['coordinator']['dns']['database']['user'],
'pdns_postgresql_password': o_config['pvc']['coordinator']['dns']['database']['pass'],
'vni_dev': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['name'],
'vni_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['mtu'],
'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['cluster'],
'storage_dev': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['name'],
'storage_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['mtu'],
'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['storage'],
'upstream_dev': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['name'],
'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['mtu'],
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['upstream'],
'vni_dev': o_config['pvc']['system']['configuration']['networking']['cluster']['name'],
'vni_mtu': o_config['pvc']['system']['configuration']['networking']['cluster']['mtu'],
'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['cluster']['address'],
'storage_dev': o_config['pvc']['system']['configuration']['networking']['storage']['name'],
'storage_mtu': o_config['pvc']['system']['configuration']['networking']['storage']['mtu'],
'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['storage']['address'],
'upstream_dev': o_config['pvc']['system']['configuration']['networking']['upstream']['name'],
'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['upstream']['mtu'],
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'],
}
except Exception as e:
print('ERROR: {}!'.format(e))