mirror of
https://github.com/eblot/pybootd.git
synced 2024-09-11 22:17:44 +03:00
Merge pull request #7 from skrubly/master
Added always_check option for http auth
This commit is contained in:
commit
a3550d4bb9
@ -30,6 +30,7 @@ set_gateway = true
|
||||
location = 127.0.0.1:13400
|
||||
pxe = boot
|
||||
dhcp = linux
|
||||
always_check = disable
|
||||
|
||||
[tftp]
|
||||
;address = (use address from bootpd)
|
||||
|
@ -409,6 +409,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
|
||||
@ -417,7 +418,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)
|
||||
|
Loading…
Reference in New Issue
Block a user