Bug 947793 - Rootwrap is not set correctly for agents
Summary: Rootwrap is not set correctly for agents
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-quantum
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Perry Myers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-03 09:24 UTC by Gary Kotton
Modified: 2016-04-27 03:59 UTC (History)
10 users (show)

Fixed In Version: openstack-quantum-2013.1.1-5.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-07 01:28:16 UTC
Type: Bug


Attachments (Terms of Use)

Description Gary Kotton 2013-04-03 09:24:23 UTC
Description of problem:
In Grizzly the rootwrap was moved to the Quantum.conf file under the [AGENT] section. This is not updated when the packages are installed.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
2013-04-03 05:23:59    ERROR [quantum.agent.dhcp_agent] Unable to enable dhcp.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/quantum/agent/dhcp_agent.py", line 129, in call_driver
    getattr(driver, action)()
  File "/usr/lib/python2.7/site-packages/quantum/agent/linux/dhcp.py", line 117, in enable
    reuse_existing=True)
  File "/usr/lib/python2.7/site-packages/quantum/agent/dhcp_agent.py", line 550, in setup
    namespace=namespace)
  File "/usr/lib/python2.7/site-packages/quantum/agent/linux/interface.py", line 174, in plug
    internal=internal)
  File "/usr/lib/python2.7/site-packages/quantum/agent/linux/interface.py", line 152, in _ovs_add_port
    utils.execute(cmd, self.root_helper)
  File "/usr/lib/python2.7/site-packages/quantum/agent/linux/utils.py", line 61, in execute
    raise RuntimeError(m)
RuntimeError:
Command: ['sudo', 'ovs-vsctl', '--', '--may-exist', 'add-port', 'br-int', 'tap2866eed8-b8', '--', 'set', 'Interface', 'tap2866eed8-b8', 'type=internal', '--', 'set', 'Interface', 'tap2866eed8-b8', 'external-ids:iface-id=2866eed8-b848-454d-824d-f0af6d258933', '--', 'set', 'Interface', 'tap2866eed8-b8', 'external-ids:iface-status=active', '--', 'set', 'Interface', 'tap2866eed8-b8', 'external-ids:attached-mac=fa:16:3e:81:90:9a']
Exit code: 1
Stdout: ''
Stderr: 'sudo: no tty present and no askpass program specified\n'

Comment 1 Fedora Update System 2013-04-03 10:51:56 UTC
openstack-quantum-2013.1-0.7.rc3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openstack-quantum-2013.1-0.7.rc3.fc19

Comment 2 Fedora Update System 2013-04-03 16:10:13 UTC
Package openstack-quantum-2013.1-0.7.rc3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openstack-quantum-2013.1-0.7.rc3.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4755/openstack-quantum-2013.1-0.7.rc3.fc19
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2013-04-08 08:12:47 UTC
openstack-quantum-2013.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openstack-quantum-2013.1-1.fc19

Comment 4 Fedora Update System 2013-05-13 07:20:21 UTC
openstack-quantum-2013.1.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openstack-quantum-2013.1.1-1.fc19

Comment 5 Matthias Runge 2013-05-23 07:01:34 UTC
This issue is still happening for me, from /var/log/messages:
May 23 09:00:48 turing quantum-openvswitch-agent[1375]: Exit code: 1
May 23 09:00:48 turing quantum-openvswitch-agent[1375]: Stdout: ''
May 23 09:00:48 turing quantum-openvswitch-agent[1375]: Stderr: 'sudo: no tty present and no askpass program specified\n'
May 23 09:00:49 turing quantum-openvswitch-agent[1375]: 2013-05-23 09:00:49    ERROR [quantum.agent.linux.ovs_lib] Unable to execute ['ovs-vsctl', '--timeout=2', 'list-ports', 'br-int']. Exception:
May 23 09:00:49 turing quantum-openvswitch-agent[1375]: Command: ['sudo', 'ovs-vsctl', '--timeout=2', 'list-ports', 'br-int']
May 23 09:00:49 turing quantum-openvswitch-agent[1375]: Exit code: 1
May 23 09:00:49 turing quantum-openvswitch-agent[1375]: Stdout: ''
May 23 09:00:49 turing quantum-openvswitch-agent[1375]: Stderr: 'sudo: no tty present and no askpass program specified\n'

Comment 6 Gary Kotton 2013-05-23 11:00:16 UTC
Thanks,
I have found the problem:

# Configure agents to use quantum-rootwrap
sed -i 's/^root_helper.*/root_helper = sudo quantum-rootwrap \/etc\/quantum\/rootwrap.conf/g' %{buildroot}%{_sysconfdir}/quantum/quantum.conf

The problem is that in the quantum.conf file this is:
# root_helper = sudo

So the scrip will just change it to:

# root_helper = sudo quantum....

I have fixed.

diff --git a/openstack-quantum.spec b/openstack-quantum.spec
index 52bc10d..f818d34 100644
--- a/openstack-quantum.spec
+++ b/openstack-quantum.spec
@@ -343,7 +343,7 @@ mv %{buildroot}/usr/etc/quantum/* %{buildroot}%{_sysconfdir}/quantum
 chmod 640  %{buildroot}%{_sysconfdir}/quantum/plugins/*/*.ini
 
 # Configure agents to use quantum-rootwrap
-sed -i 's/^root_helper.*/root_helper = sudo quantum-rootwrap \/etc\/quantum\/rootwrap.conf/g' %{buildroot}%{_sysconfdir}/quantum/quantum.conf
+sed -i 's/^# root_helper.*/root_helper = sudo quantum-rootwrap \/etc\/quantum\/rootwrap.conf/g' %{buildroot}%{_sysconfdir}/quantum/quantum.conf
 
 # Configure quantum-dhcp-agent state_path
 sed -i 's/state_path = \/opt\/stack\/data/state_path = \/var\/lib\/quantum/' %{buildroot}%{_sysconfdir}/quantum/dhcp_agent.ini

Comment 7 Fedora Update System 2013-05-28 14:02:23 UTC
openstack-quantum-2013.1.1-5.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openstack-quantum-2013.1.1-5.fc19

Comment 8 Fedora Update System 2013-05-28 16:14:21 UTC
Package openstack-quantum-2013.1.1-5.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openstack-quantum-2013.1.1-5.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9454/openstack-quantum-2013.1.1-5.fc19
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-07-07 01:28:16 UTC
openstack-quantum-2013.1.1-5.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.