1
1
mirror of https://github.com/eblot/pybootd.git synced 2024-09-11 22:17:44 +03:00

Added always_check option for http auth

This commit is contained in:
skrubly 2015-06-18 10:47:54 -07:00
parent d4ad0a479d
commit 982a6728a0
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@ boot_file = pxelinux.0
location = 127.0.0.1:13400
pxe = boot
dhcp = linux
always_check = disable
[tftp]
;address = (use address from bootpd)

View File

@ -394,6 +394,7 @@ class BootpServer:
netloc = self.config.get(self.access, 'location')
path = self.config.get(self.access, pxe and 'pxe' or 'dhcp')
timeout = int(self.config.get(self.access, 'timeout', '5'))
always_check = self.config.get(self.access, 'always_check')
parameters = {'mac' : mac_str}
if uuid:
parameters['uuid'] = uuid_str
@ -402,7 +403,10 @@ class BootpServer:
item = uuid_str or mac_str
# only bother the authentication host when a state change is
# required.
if currentstate != newstate:
checkhost = currentstate != newstate
if to_bool(always_check):
checkhost = True
if checkhost:
query = urllib.urlencode(parameters)
urlparts = (self.access, netloc, path, query, '')
url = urlparse.urlunsplit(urlparts)