diff --git a/confluent_server/confluent/discovery/protocols/pxe.py b/confluent_server/confluent/discovery/protocols/pxe.py index 648023ef..ada20b36 100644 --- a/confluent_server/confluent/discovery/protocols/pxe.py +++ b/confluent_server/confluent/discovery/protocols/pxe.py @@ -822,12 +822,13 @@ async def reply_dhcp4(node, info, packet, cfg, reqview, httpboot, cfd, profile, if not profile: log.log({'info': 'No pending profile for {0}, skipping proxyDHCP reply'.format(node)}) return - bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe'.format(myipn, profile).encode('utf8') + if disco['arch'] == 'bios-x86' or not os.path.exists('/var/lib/confluent/public/os/{0}/boot.ipxe.shim'.format(profile)): + bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe'.format(myipn, profile).encode('utf8') + else: + bootfile = 'http://{0}/confluent-public/os/{1}/boot.ipxe.shim'.format(myipn, profile).encode('utf8') if len(bootfile) > 127: if bootfile.startswith(b'http'): - bootshorturl = '/confluent-public/os/{0}/boot.ipxe'.format(profile) - bootfilename = '/var/lib/confluent/public/os/{0}/boot.ipxe'.format(profile) - bootfile = register_shorturl(bootfile.decode('utf8'), can302, bootshorturl, bootfilename).encode('utf8') + bootfile = register_shorturl(bootfile.decode('utf8')).encode('utf8') else: log.log( {'info': 'Boot offer cannot be made to {0} as the ' diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index b8ce288b..5bf6f1ca 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -260,6 +260,7 @@ async def update_boot_linux(profiledir, profile, label): ipxeout.write('imgload kernel\nimgexec kernel\n') finally: ipxeout.close() + oum = os.umask(0o22) ipout = os.open(profiledir + '/boot.ipxe', os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0o644) ipxeout = os.fdopen(ipout, 'w') try: