Skip to content

Commit

Permalink
Merge "Adding netmask to dnsmasq argument --dhcp-range"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 28, 2013
2 parents 71c422d + fb151b5 commit 7bf541c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nova/network/linux_net.py
Expand Up @@ -1019,9 +1019,10 @@ def restart_dhcp(context, dev, network_ref):
'--pid-file=%s' % _dhcp_file(dev, 'pid'),
'--listen-address=%s' % network_ref['dhcp_server'],
'--except-interface=lo',
'--dhcp-range=set:%s,%s,static,%ss' %
'--dhcp-range=set:%s,%s,static,%s,%ss' %
(network_ref['label'],
network_ref['dhcp_start'],
network_ref['netmask'],
CONF.dhcp_lease_time),
'--dhcp-lease-max=%s' % len(netaddr.IPNetwork(network_ref['cidr'])),
'--dhcp-hostsfile=%s' % _dhcp_file(dev, 'conf'),
Expand Down
4 changes: 3 additions & 1 deletion nova/tests/network/test_linux_net.py
Expand Up @@ -480,6 +480,7 @@ def _test_dnsmasq_execute(self, extra_expected=None):
'label': 'fake',
'multi_host': False,
'cidr': '10.0.0.0/24',
'netmask': '255.255.255.0',
'dns1': '8.8.4.4',
'dhcp_start': '1.0.0.2',
'dhcp_server': '10.0.0.1'}
Expand Down Expand Up @@ -507,8 +508,9 @@ def fake_execute(*args, **kwargs):
'--pid-file=%s' % linux_net._dhcp_file(dev, 'pid'),
'--listen-address=%s' % network_ref['dhcp_server'],
'--except-interface=lo',
"--dhcp-range=set:%s,%s,static,%ss" % (network_ref['label'],
"--dhcp-range=set:%s,%s,static,%s,%ss" % (network_ref['label'],
network_ref['dhcp_start'],
network_ref['netmask'],
CONF.dhcp_lease_time),
'--dhcp-lease-max=256',
'--dhcp-hostsfile=%s' % linux_net._dhcp_file(dev, 'conf'),
Expand Down

0 comments on commit 7bf541c

Please sign in to comment.