def ipxe():
"""
iPXE
---
tags:
- matchbox
responses:
200:
description: iPXE script
schema:
type: string
404:
description: Not valid
schema:
type: string
"""
app.logger.info("%s %s" % (request.method, request.url))
try:
matchbox_resp = requests.get(
"%s%s" % (
app.config["MATCHBOX_URI"],
request.full_path))
matchbox_resp.close()
response = matchbox_resp.content.decode()
mac = request.args.get("mac")
if mac:
repositories.machine_state.update(mac.replace("-", ":"), MachineStates.booting)
return Response(response, status=200, mimetype="text/plain")
except requests.exceptions.ConnectionError:
app.logger.warning("404 for /ipxe")
return "404", 404
评论列表
文章目录