Skip to content

Commit 23bb341

Browse files
marklandisbsanders
authored andcommitted
BUGFIX: Import sys for the rare error path
Also cleanup some dangling whitespace.
1 parent 3f72206 commit 23bb341

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

common/src/stack/pxeboot/setPxeboot.cgi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import os
1616
import cgi
1717
import syslog
1818
import json
19+
import sys
1920
import stack.api
2021

2122
syslog.openlog('setPxeBoot.cgi', syslog.LOG_PID, syslog.LOG_LOCAL0)
@@ -28,7 +29,7 @@ if 'REMOTE_ADDR' in os.environ:
2829
ipaddr = os.environ['REMOTE_ADDR']
2930
if not ipaddr:
3031
sys.exit(-1)
31-
32+
3233
syslog.syslog(syslog.LOG_INFO, 'remote addr %s' % ipaddr)
3334

3435
# 'params' field should be a python dictionary of the form:
@@ -54,7 +55,7 @@ try:
5455
except:
5556
syslog.syslog(syslog.LOG_ERR, 'missing params')
5657

57-
58+
5859
# The above let's us set the boot action to anything (e.g. 'install') but
5960
# here we lock thing down to only allow a reset to 'os'.
6061

@@ -66,7 +67,7 @@ if action == 'os':
6667
'value=false'])
6768
stack.api.Call('set host attr', [ ipaddr, 'attr=secureerase',
6869
'value=false'])
69-
70+
7071
print('Content-type: application/octet-stream')
7172
print('Content-length: %d' % (len('')))
7273
print('')

0 commit comments

Comments
 (0)