dhcp agent uses root_helper setting from dhcp_agent.ini and quantum.conf

Bug #1178003 reported by Peter Feiner
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Peter Feiner
Grizzly
Fix Released
High
Gary Kotton

Bug Description

Generally, the dhcp agent uses the root_helper setting from the [AGENT] section of /etc/quantum/quantum.conf. However, there are a couple of places where it uses root_helper from the [DEFAULT] section of /etc/quantum/dhcp_agent.ini. I discovered this problem after I followed the latest openstack installation guide for ubuntu. I saw messages like this in the dhcp_agent log file:

Command: ['sudo', 'ip', 'netns', 'exec', 'qdhcp-0ad970b3-4f9e-445c-8b87-018d74fd02f2', 'quantum-ns-metadata-proxy', '--pid_file=/var/lib/q
uantum/external/pids/0ad970b3-4f9e-445c-8b87-018d74fd02f2.pid', '--network_id=0ad970b3-4f9e-445c-8b87-018d74fd02f2', '--state_path=/var/li
b/quantum', '--metadata_port=80', '--debug', '--verbose', '--log-file=quantum-ns-metadata-proxy0ad970b3-4f9e-445c-8b87-018d74fd02f2.log',
'--log-dir=/var/log/quantum']
Exit code: 1
Stdout: ''
Stderr: 'sudo: no tty present and no askpass program specified\nSorry, try again.\nsudo: no tty present and no askpass program specified\nSorry, try again.\nsudo: no tty present and no askpass program specified\nSorry, try again.\nsudo: 3 incorrect password attempts\n'
2013-05-08 06:43:40 ERROR [quantum.agent.dhcp_agent] Unable to sync network state.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/quantum/agent/dhcp_agent.py", line 155, in sync_state
    self.refresh_dhcp_helper(network_id)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/dhcp_agent.py", line 209, in refresh_dhcp_helper
    return self.enable_dhcp_helper(network_id)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/dhcp_agent.py", line 188, in enable_dhcp_helper
    self.enable_isolated_metadata_proxy(network)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/dhcp_agent.py", line 329, in enable_isolated_metadata_proxy
    pm.enable(callback)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/linux/external_process.py", line 55, in enable
    ip_wrapper.netns.execute(cmd)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/linux/ip_lib.py", line 407, in execute
    check_exit_code=check_exit_code)
  File "/usr/lib/python2.7/dist-packages/quantum/agent/linux/utils.py", line 61, in execute
    raise RuntimeError(m)

I'm going to submit a patch in a moment.

Tags: l3-ipam-dhcp
Peter Feiner (pete5)
Changed in quantum:
assignee: nobody → Peter Feiner (pete5)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
status: New → In Progress
Revision history for this message
Gary Kotton (garyk) wrote :

Hi,
Can you please clarify why the root_helper is still defined in the dhcp agent ini file?
Thanks
Gary

tags: added: grizzly-backport-potential l3-ipam-dhcp
Changed in quantum:
importance: Undecided → High
Revision history for this message
Peter Feiner (pete5) wrote :

Hi Gary,

As far as I understand, per your patch, root_helper is still defined in the dhcp agent ini file for backward compatibility wild old config files:

https://github.com/openstack/quantum/commit/1b7565b83ca8ef9761cdfb1eed1e9eb9498ea340#L7R44

If root_helper is missing from the new location ([AGENT] in quantum.conf), then it's read from the old location ([DEFAULT] in dhcp_agent.ini), and you get a warning message about deprecation.

Peter

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/28630
Committed: http://github.com/openstack/quantum/commit/8a9e7ac7f2e3901d33c8a6a91dffec1e16b13f0d
Submitter: Jenkins
Branch: master

commit 8a9e7ac7f2e3901d33c8a6a91dffec1e16b13f0d
Author: Peter Feiner <email address hidden>
Date: Wed May 8 17:53:21 2013 -0400

    in dhcp_agent, always use quantum.conf root_helper

    Fixes bug #1178003.

    For the most part, the dhcp agent uses the root_helper setting from the [AGENT]
    section of /etc/quantum/quantum.conf. However, in a couple of spots, the
    root_helper setting from the [DEFAULT] section of /etc/quantum/dhcp_agent.ini
    was being used.

    Change-Id: Id2f3140374a705cf7a0d2a784e4f321cc54f602e

Changed in quantum:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/28699

Changed in quantum:
milestone: none → havana-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (stable/grizzly)

Reviewed: https://review.openstack.org/28699
Committed: http://github.com/openstack/quantum/commit/1841ea56a9eb945d045d4fb8f51fb4a968fe36b2
Submitter: Jenkins
Branch: stable/grizzly

commit 1841ea56a9eb945d045d4fb8f51fb4a968fe36b2
Author: Peter Feiner <email address hidden>
Date: Wed May 8 17:53:21 2013 -0400

    in dhcp_agent, always use quantum.conf root_helper

    Fixes bug #1178003.

    For the most part, the dhcp agent uses the root_helper setting from the [AGENT]
    section of /etc/quantum/quantum.conf. However, in a couple of spots, the
    root_helper setting from the [DEFAULT] section of /etc/quantum/dhcp_agent.ini
    was being used.

    Change-Id: Id2f3140374a705cf7a0d2a784e4f321cc54f602e

tags: added: in-stable-grizzly
Gary Kotton (garyk)
tags: removed: grizzly-backport-potential
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
tags: removed: in-stable-grizzly
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-1 → 2013.2
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.