From 258c4970c0c4edfbd95cbb8177039dd437e7806d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 4 Aug 2022 10:39:10 -0400 Subject: [PATCH] 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. --- .../esxi7/profiles/hypervisor/scripts/makeksnet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet b/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet index 371c1e45..9b2041fb 100644 --- a/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet +++ b/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet @@ -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) \ No newline at end of file +print(netline)