projects
/
invirt/packages/invirt-dhcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ba2cb07
)
Style nits for Quentin.
author
Mitchell E Berger
<mitchb@mit.edu>
Tue, 22 May 2018 23:41:57 +0000
(19:41 -0400)
committer
Mitchell E Berger
<mitchb@mit.edu>
Tue, 22 May 2018 23:41:57 +0000
(19:41 -0400)
invirt-dhcpserver
patch
|
blob
|
history
diff --git
a/invirt-dhcpserver
b/invirt-dhcpserver
index
970bc5c
..
e049f15
100755
(executable)
--- a/
invirt-dhcpserver
+++ b/
invirt-dhcpserver
@@
-20,7
+20,7
@@
from invirt import database
from invirt.config import structs as config
dhcp_options = {'domain_name_server': ','.join(config.dhcp.dns),
from invirt.config import structs as config
dhcp_options = {'domain_name_server': ','.join(config.dhcp.dns),
- 'ip_address_lease_time': config.dhcp.leasetime if config.dhcp.has_key('leasetime') else 60*60*24}
+ 'ip_address_lease_time': config.dhcp.get('leasetime', 60*60*24)}
class DhcpBackend:
def __init__(self, queue):
class DhcpBackend:
def __init__(self, queue):
@@
-153,7
+153,7
@@
class DhcpBackend:
s.syslog(s.LOG_ERR, "Interface is %s" % (intf))
# Don't perform "other" actions if the machine isn't running
other_action = n.other_action if n.other_action and intf else ''
s.syslog(s.LOG_ERR, "Interface is %s" % (intf))
# Don't perform "other" actions if the machine isn't running
other_action = n.other_action if n.other_action and intf else ''
- if other_action == 'renumber' or other_action == 'renumber_dhcp':
+ if other_action in ('renumber', 'renumber_dhcp'):
(n.ip, n.netmask, n.gateway, n.other_ip, n.other_netmask,
n.other_gateway) = (
n.other_ip, n.other_netmask, n.other_gateway, n.ip,
(n.ip, n.netmask, n.gateway, n.other_ip, n.other_netmask,
n.other_gateway) = (
n.other_ip, n.other_netmask, n.other_gateway, n.ip,