From 23bb341490e2011bb5e3b29da5924e888b28b56a Mon Sep 17 00:00:00 2001 From: marklandis <51216255+marklandis@users.noreply.github.com> Date: Thu, 30 May 2019 21:45:12 -0700 Subject: [PATCH] BUGFIX: Import sys for the rare error path Also cleanup some dangling whitespace. --- common/src/stack/pxeboot/setPxeboot.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/stack/pxeboot/setPxeboot.cgi b/common/src/stack/pxeboot/setPxeboot.cgi index f2984f2eb..d6d57a32f 100755 --- a/common/src/stack/pxeboot/setPxeboot.cgi +++ b/common/src/stack/pxeboot/setPxeboot.cgi @@ -16,6 +16,7 @@ import os import cgi import syslog import json +import sys import stack.api syslog.openlog('setPxeBoot.cgi', syslog.LOG_PID, syslog.LOG_LOCAL0) @@ -28,7 +29,7 @@ if 'REMOTE_ADDR' in os.environ: ipaddr = os.environ['REMOTE_ADDR'] if not ipaddr: sys.exit(-1) - + syslog.syslog(syslog.LOG_INFO, 'remote addr %s' % ipaddr) # 'params' field should be a python dictionary of the form: @@ -54,7 +55,7 @@ try: except: syslog.syslog(syslog.LOG_ERR, 'missing params') - + # The above let's us set the boot action to anything (e.g. 'install') but # here we lock thing down to only allow a reset to 'os'. @@ -66,7 +67,7 @@ if action == 'os': 'value=false']) stack.api.Call('set host attr', [ ipaddr, 'attr=secureerase', 'value=false']) - + print('Content-type: application/octet-stream') print('Content-length: %d' % (len(''))) print('')