summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-08-11 15:29:14 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-08-11 15:29:14 -0700
commit6664c960e08e31fa8b464b0ccbbf489da271e033 (patch)
tree43f2fac738f1fc667177c44d7755cee248a9e9bf
parent24f8cb89f8b92563d364186b80c7d73d28b26bea (diff)
downloadnova-6664c960e08e31fa8b464b0ccbbf489da271e033.tar.gz
nova-6664c960e08e31fa8b464b0ccbbf489da271e033.tar.xz
nova-6664c960e08e31fa8b464b0ccbbf489da271e033.zip
fix dhcpbridge issues
-rwxr-xr-xbin/nova-dhcpbridge2
-rw-r--r--nova/network/linux_net.py8
-rw-r--r--nova/network/service.py8
3 files changed, 7 insertions, 11 deletions
diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge
index b1ad1c8fe..f70a4482c 100755
--- a/bin/nova-dhcpbridge
+++ b/bin/nova-dhcpbridge
@@ -69,7 +69,7 @@ def init_leases(interface):
"""Get the list of hosts for an interface."""
net = model.get_network_by_interface(interface)
res = ""
- for address in net.address_objs:
+ for address in net.assigned_objs:
res += "%s\n" % linux_net.host_dhcp(address)
return res
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index 4ebc2097b..15050adaf 100644
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -116,7 +116,7 @@ def _dnsmasq_cmd(net):
' --pid-file=%s' % dhcp_file(net['vlan'], 'pid'),
' --listen-address=%s' % net.dhcp_listen_address,
' --except-interface=lo',
- ' --dhcp-range=%s,static,600s' % net.dhcp_range_start,
+ ' --dhcp-range=%s,static,120s' % net.dhcp_range_start,
' --dhcp-hostsfile=%s' % dhcp_file(net['vlan'], 'conf'),
' --dhcp-script=%s' % bin_file('nova-dhcpbridge'),
' --leasefile-ro']
@@ -153,14 +153,10 @@ def start_dnsmasq(network):
# correct dnsmasq process
try:
os.kill(pid, signal.SIGHUP)
+ return
except Exception as exc: # pylint: disable=W0703
logging.debug("Hupping dnsmasq threw %s", exc)
- # otherwise delete the existing leases file and start dnsmasq
- lease_file = dhcp_file(network['vlan'], 'leases')
- if os.path.exists(lease_file):
- os.unlink(lease_file)
-
# FLAGFILE and DNSMASQ_INTERFACE in env
env = {'FLAGFILE': FLAGS.dhcpbridge_flagfile,
'DNSMASQ_INTERFACE': network['bridge_name']}
diff --git a/nova/network/service.py b/nova/network/service.py
index 9c0f5520b..625f20dd4 100644
--- a/nova/network/service.py
+++ b/nova/network/service.py
@@ -226,13 +226,13 @@ class VlanNetworkService(BaseNetworkService):
"""Returns an ip to the pool"""
return model.get_network_by_address(fixed_ip).deallocate_ip(fixed_ip)
- def lease_ip(self, address):
+ def lease_ip(self, fixed_ip):
"""Called by bridge when ip is leased"""
- return model.get_network_by_address(address).lease_ip(address)
+ return model.get_network_by_address(fixed_ip).lease_ip(fixed_ip)
- def release_ip(self, address):
+ def release_ip(self, fixed_ip):
"""Called by bridge when ip is released"""
- return model.get_network_by_address(address).release_ip(address)
+ return model.get_network_by_address(fixed_ip).release_ip(fixed_ip)
def restart_nets(self):
"""Ensure the network for each user is enabled"""