2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-14 19:57:50 +00:00

Change makeksnet from yaml to json

Older vmware did just json, which is fine, just have to use
the json file that was there just in case something like this
came up.
This commit is contained in:
Jarrod Johnson 2022-08-04 10:39:10 -04:00
parent 610e7bf044
commit 258c4970c0

View File

@ -1,7 +1,7 @@
#!/usr/bin/python
import re
import subprocess
import yaml
import json
uplinkmatch = re.compile('^\s*Uplinks:\s*(.*)')
nodename = None
for inf in open('/etc/confluent/confluent.info', 'r').read().split('\n'):
@ -34,8 +34,8 @@ for info in vswinfo.split('\n'):
if upinfo:
vmnic = upinfo.group(1)
try:
with open('/tmp/confluentident/cnflnt.yml') as identin:
identcfg = yaml.safe_load(identin)
with open('/tmp/confluentident/cnflnt.jsn') as identin:
identcfg = json.load(identin)
ncfg = identcfg['net_cfgs'][0]
cfg['ipv4_method'] = ncfg['ipv4_method']
cfg['ipv4_address'] = ncfg['ipv4_address'].split('/')[0]
@ -52,4 +52,4 @@ if cfg['ipv4_method'] == 'static':
netline += ' --gateway={0}'.format(cfg['ipv4_gateway'])
if cfg['nameservers']:
netline += ' --nameserver={0}'.format(cfg['nameservers'])
print(netline)
print(netline)