vs_port is broken in current master (at least for Red Hat)

Bug #1556147 reported by Javier Peña
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-vswitch
Fix Released
Undecided
Javier Peña

Bug Description

The following manifest fails in Red Hat-based platforms:

vs_bridge {'br-eth0':
  ensure => present,
  external_ids => "bridge-id=br-eth0"
}

vs_port {'eth0':
  ensure => present,
  bridge => 'br-eth0',
}

It fails with the following error:

Error: /Vs_port[eth0]: Could not evaluate: undefined method `sub' for ["eth0"]:Array

This issue seems to be caused by the fact that parameter :interface for the type is now an array instead of a string, as it used to be.

Additionally, there seems to be something else broken in ovs.rb (not sure if it is related to the bug or not). https://github.com/openstack/puppet-vswitch/blob/master/lib/puppet/provider/vs_port/ovs.rb#L22 uses a variable @iface0 that does not seem to be defined anywhere.

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

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

Changed in puppet-vswitch:
assignee: nobody → Javier Peña (jpena-c)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-vswitch (master)

Reviewed: https://review.openstack.org/291788
Committed: https://git.openstack.org/cgit/openstack/puppet-vswitch/commit/?id=bd3b2af4e9648fdebee1538ca6b33c4f092e2158
Submitter: Jenkins
Branch: master

commit bd3b2af4e9648fdebee1538ca6b33c4f092e2158
Author: Javier Pena <email address hidden>
Date: Fri Mar 11 16:57:56 2016 +0100

    Fix vs_port provider for Red Hat platforms

    https://review.openstack.org/124789 separated the interface
    parameter from the port name. It added compatibility for
    ovs_redhat.rb by setting resource[:interface] = @resource[:port],
    however :interface was a string and is now an array, which breaks
    vs_port usage.

    Using @resource[:port] instead of :interface fixes the provider,
    and then we need to avoid using self.bonding? and self.vlan?,
    because using them causes the following error:

    "Error: Could not set 'present' on ensure: private method `bonding?'
    called for #<Puppet::Type::Vs_port::ProviderOvs_redhat:0x000000028e8a30>"

    Change-Id: I76fba53a34ff182881022066abde0a2c5dc8d066
    Closes-Bug: #1556147

Changed in puppet-vswitch:
status: In Progress → 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.