Wrong syntax for set:tag in dnsmasq startup options

Bug #1152504 reported by Vincent Hurtevent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Davanum Srinivas (DIMS)
Folsom
Fix Released
Medium
Vish Ishaya

Bug Description

Openstack Folsom
Nova-network

Multihost Vlan configuration and use of dnsmasq_config_file to pass options per vlans (such as external gateway).

The syntax in dnsmasq call is wrong, the vlan tag is between quote

--dhcp-range=set:'1274',172.16.88.3,static,120s

The call is made in linux_net.py, in Folsom, line 843.

'--dhcp-range=set:\'%s\',%s,static,%ss' %
                         (network_ref['label'],
                          network_ref['dhcp_start'],
                          CONF.dhcp_lease_time),

Removing quotes resolves the issue and dnsmasq is working well with per network options.

Jeremy Stanley (fungi)
affects: openstack-ci → nova
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

looks like this code was introduced in https://bugs.launchpad.net/nova/+bug/1012443

The paste in the bug description shows set: w/o the single quotes - http://paste.openstack.org/show/18471/

Man page shows no quotes either http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Last but not the least, per Vincent, removing quotes resolves the issue, so just going to submit a patch that removes the quotes.

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23928

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23928
Committed: http://github.com/openstack/nova/commit/d8188ef32293659c5a12d99f82ac19b452184967
Submitter: Jenkins
Branch: master

commit d8188ef32293659c5a12d99f82ac19b452184967
Author: Davanum Srinivas <email address hidden>
Date: Fri Mar 8 10:26:57 2013 -0500

    Fix Wrong syntax for set:tag in dnsmasq startup option

    Looks like the introduction of quotes in fix for previous
    bug 1012443 was erroneous.

    Fixes LP# 1152504

    Change-Id: Ic84739e38e3b3567f1617302a33623de03196f85

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Nathanael Burton (mathrock) wrote :

If I recall correctly the quotes were necessary to account for people specifying a tag that had spaces in it. From my testing, as long as you quote in both places (dnsmasq.conf file and the cli startup flags) it should work. This is what the example docs at http://docs.openstack.org/trunk/openstack-compute/admin/content/existing-ha-networking-options.html show. Are you sure you had the tag quoted in your conf file?

Revision history for this message
Nathanael Burton (mathrock) wrote :

That being said, I don't think it's common for people to use tags with spaces in them.

Revision history for this message
Nathanael Burton (mathrock) wrote :

Thinking about this more, I'd be nervous about this change (removing the quotes) from breaking people who are already using this with quotes in their dnsmasq.conf.

Revision history for this message
Vincent Hurtevent (vincent-hurtevent-t) wrote :

Ok, I made some tests to be sure :

- Added a network through nova-manage network with name 'vlan 1274'

I tested with and without quotes in dnsmasq_nova_conf file :

dnsmasq_nova_conf file : dhcp-option=tag:vlan 1274,option:router,172.16.88.1
dnsmasq startup command : --dhcp-range=set:vlan 1274,172.16.88.3,static,120s

dnsmasq_nova_conf file : dhcp-option=tag:'vlan 1274',option:router,172.16.88.1
dnsmasq startup command : --dhcp-range=set:'vlan 1274',172.16.88.3,static,120s

Both are working since the syntax is the same between the dnsmasq_nova_conf file and dnsmasq startup options.

Don't know if dnsmasq really takes the inner quotted string or the whole stuff.

Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/25586

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/25586
Committed: http://github.com/openstack/nova/commit/50dece6ff2cc94a0ecd0fe9a26c3917e70fe3434
Submitter: Jenkins
Branch: stable/folsom

commit 50dece6ff2cc94a0ecd0fe9a26c3917e70fe3434
Author: Davanum Srinivas <email address hidden>
Date: Fri Mar 8 10:26:57 2013 -0500

    Fix Wrong syntax for set:tag in dnsmasq startup option

    Looks like the introduction of quotes in fix for previous
    bug 1012443 was erroneous.

    Fixes LP# 1152504

    Change-Id: Ic84739e38e3b3567f1617302a33623de03196f85
    (cherry picked from commit d8188ef32293659c5a12d99f82ac19b452184967)

Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.