dnsmasq version check should set C locale

Bug #1412738 reported by Philipp Marek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Xu Han Peng

Bug Description

From my logfiles (shortened, redacted):

2015-01-20 11:22:36.853 DEBUG neutron.agent.linux.utils [] Running command:
  ['dnsmasq', '--version'] from (pid=3481) create_process
  /opt/stack/neutron/neutron/agent/linux/utils.py:46
2015-01-20 11:22:37.052 DEBUG neutron.agent.linux.utils []
  Command: ['dnsmasq', '--version']
  Exit code: 0
  Stdout: 'Dnsmasq Version 2.68 Copyright (c) 2000-2013 Simon Kelley\n
   Compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6
     no-Lua TFTP conntrack ipset auth\n\n
   F\xc3\xbcr diese Software wird ABSOLUT KEINE GARANTIE gew\xc3\xa4hrt.\n
   Dnsmasq ist freie Software, und du bist willkommen es weiter zu verteilen\n
   unter den Bedingungen der GNU General Public Lizenz, Version 2 oder 3.\n'
  Stderr: '' from (pid=3481) execute /opt/stack/neutron/neutron/agent/linux/utils.py:79
2015-01-20 11:22:37.082 ERROR neutron.agent.linux.dhcp []
  FAILED VERSION REQUIREMENT FOR DNSMASQ.
  Please ensure that its version is 2.67 or above!

I guess that my locale (that was used on ./rejoin-stack) interfered with the
version detection.

My devstack has neutron at

commit 2c94b10d741f3a9d96b548cc051850467468c8de
Merge: b3ae161 c7e533c
Author: Jenkins <email address hidden>
Date: Wed Jan 14 00:38:28 2015 +0000

    Merge "Allow IptablesManager to manage mangle table"

Revision history for this message
Xu Han Peng (xuhanp) wrote :

I think the problem is not about locale but the output dnsmasq --version. The code is trying to look for "version" instead of "Version".

Revision history for this message
Philipp Marek (philipp-marek) wrote :

Yeah, and the code is correct - "version" is the "native" output.

I think Neutron shouldn't try to recognize all different localizations -
just the "pure" one, LC_ALL=C.

Just set the environment variable, and you get the expected output:

  $ dnsmasq --version | grep -i version
  Dnsmasq Version 2.72 Copyright (c) 2000-2014 Simon Kelley
  unter den Bedingungen der GNU General Public Lizenz, Version 2 oder 3.
  $ LC_ALL=C dnsmasq --version | grep -i version
  Dnsmasq version 2.72 Copyright (c) 2000-2014 Simon Kelley
  under the terms of the GNU General Public License, version 2 or 3.

Xu Han Peng (xuhanp)
Changed in neutron:
assignee: nobody → Xu Han Peng (xuhanp)
Revision history for this message
Ann Taraday (akamyshnikova) wrote :

I've got the same issue with devstack.

Changed in neutron:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Reviewed: https://review.openstack.org/149524
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=082db8bf08ef28750f18a8d1f2aa22acb0971133
Submitter: Jenkins
Branch: master

commit 082db8bf08ef28750f18a8d1f2aa22acb0971133
Author: Xu Han Peng <email address hidden>
Date: Fri Jan 23 15:21:33 2015 +0800

    Set locale before check dnsmasq version

    In some locale settings, cmd "dnsmasq --version" returns unexpected
    result even when dnsmasq is the right version.

    This fix sets env variable as "LC_ALL=C" to make sure dnsmasq version
    check returns correct result.

    Change-Id: I3d1c7793632f2c62e7b54e250e052de15f978e59
    Closes-Bug:1412738

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: master
Review: https://review.openstack.org/149951
Reason: Now that I think about, not sure we should ever rely on any particular output from our tools, so adding locale enforcement to execute() is not ideal.

Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
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.