Skip to content

Commit

Permalink
a not so great fix for preventing any non NMN type of network interfa…
Browse files Browse the repository at this point in the history
…ce from getting added to the optsfile and tagged with the nidname
  • Loading branch information
travisbcotton committed Oct 9, 2024
1 parent c8a1fd1 commit f0bda4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dnsmasq_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def template_file(base_url, bootscript_base_url, access_token, hostsfilename, op
with hostsfilepath.open("w") as hostsfile:
#this for loop writes host entries
for i in ei_data:
if i['Type'] != 'NodeBMC':
itype = i['IPAddresses'][0]['Network']
if i['Type'] != 'NodeBMC' and itype == 'NMN':
nidname=getNID(component_data, i['ComponentID'])
if nidname:
print(f"{i['MACAddress']},set:{nidname},{i['IPAddresses'][0]['IPAddress']},{nidname}", file=hostsfile)
Expand All @@ -71,7 +72,8 @@ def template_file(base_url, bootscript_base_url, access_token, hostsfilename, op
with optsfilepath.open("w") as optsfile:
#this for loop writes option entries, we wouldn't need it if the BSS wasn't MAC specific
for i in ei_data:
if 'bmc' not in i['Description']:
itype = i['IPAddresses'][0]['Network']
if 'bmc' not in i['Description'] and itype == 'NMN':
nidname=getNID(component_data, i['ComponentID'])
if nidname:
print(f"tag:{nidname},tag:IPXEBOOT,option:bootfile-name,\"{bootscript_base_url}/boot/v1/bootscript?mac={i['MACAddress']}\"", file=optsfile)
Expand Down

0 comments on commit f0bda4a

Please sign in to comment.