File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import os
1616import cgi
1717import syslog
1818import json
19+ import sys
1920import stack .api
2021
2122syslog .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' ]
2930if not ipaddr :
3031 sys .exit (- 1 )
31-
32+
3233syslog .syslog (syslog .LOG_INFO , 'remote addr %s' % ipaddr )
3334
3435# 'params' field should be a python dictionary of the form:
5455except :
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+
7071print ('Content-type: application/octet-stream' )
7172print ('Content-length: %d' % (len ('' )))
7273print ('' )
You can’t perform that action at this time.
0 commit comments