Bad test for tunnel_types in OVS agent manifest

Bug #1281684 reported by Mark T. Voelker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-neutron
Fix Released
Undecided
Mark T. Voelker
Havana
Fix Released
Undecided
Unassigned

Bug Description

When VXLAN support was added to the ovs agent module, a tunnel_types parameter was added to the class and defaulted to an empty array:

https://github.com/stackforge/puppet-neutron/blob/3.0.0/manifests/agents/ovs.pp#L18

Later in the code, however, there's an if loop with an improper test:

https://github.com/stackforge/puppet-neutron/blob/3.0.0/manifests/agents/ovs.pp#L92-L96

If the default value (an empty array) is set, the if loop executes since the "if $tunnel_types" test passes for an empty array. This can cause the /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini file to have "tunnel_types =" in it, which will cause the OVS agent to refuse to start up.

The fix is to properly test the tunnel_types parameter using stdlib.

Changed in puppet-neutron:
status: New → In Progress
assignee: nobody → Mark T. Voelker (mvoelker)
summary: - Bad test for tunnel_type in OVS agent manifest
+ Bad test for tunnel_types in OVS agent manifest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-neutron (master)

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

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

Reviewed: https://review.openstack.org/74446
Committed: https://git.openstack.org/cgit/stackforge/puppet-neutron/commit/?id=f3a4b53a417db64ed7c26980893a4a8e3ccde83c
Submitter: Jenkins
Branch: master

commit f3a4b53a417db64ed7c26980893a4a8e3ccde83c
Author: Mark T. Voelker <email address hidden>
Date: Tue Feb 18 12:23:21 2014 -0500

    Fix improper test for tunnel_types param

    When VXLAN support was added to the ovs agent manifest, a new
    parameter called tunnel_types was also added with the default
    value being an empty array. However, later in the code there's
    an if loop that tests truth--and an empty array returns true.
    This causes a line of the form:

    tunnel_types =

    to show up in /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
    if the default value is used, which causes OVS to refuse to start.
    This patch corrects the problem by properly testing the array.

    Change-Id: I06ad6249ab7803676e49c026b4692f06ade269ed
    Closes-Bug: #1281684

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

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/74449

tags: added: in-stable-havana
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-neutron (stable/havana)

Reviewed: https://review.openstack.org/74449
Committed: https://git.openstack.org/cgit/stackforge/puppet-neutron/commit/?id=1d10a9413a6a340dfb161b89c458e3e1a4750215
Submitter: Jenkins
Branch: stable/havana

commit 1d10a9413a6a340dfb161b89c458e3e1a4750215
Author: Mark T. Voelker <email address hidden>
Date: Tue Feb 18 12:23:21 2014 -0500

    Fix improper test for tunnel_types param

    When VXLAN support was added to the ovs agent manifest, a new
    parameter called tunnel_types was also added with the default
    value being an empty array. However, later in the code there's
    an if loop that tests truth--and an empty array returns true.
    This causes a line of the form:

    tunnel_types =

    to show up in /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
    if the default value is used, which causes OVS to refuse to start.
    This patch corrects the problem by properly testing the array.

    Change-Id: I06ad6249ab7803676e49c026b4692f06ade269ed
    Closes-Bug: #1281684
    (cherry picked from commit f3a4b53a417db64ed7c26980893a4a8e3ccde83c)

Mathieu Gagné (mgagne)
Changed in puppet-neutron:
milestone: none → 4.0.0
status: Fix Committed → Fix Released
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.