neutron_subnet provider fails when a identity v2 tenant is used

Bug #1515787 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-neutron
Fix Released
High
Unassigned

Bug Description

I believe this is related to the naming convention change as part of https://review.openstack.org/#/c/226919/, but I'm getting a failure when I attempt to use neutron_* providers that attempt to lookup the tenant using the tenant_name variable.

The error message I get is:

Error: Could not set 'present' on ensure: Unable to find Keystone_tenant for name admin at 47:/etc/puppet/modules/osnailyfacter/modular/openstack-network/networks.pp
Error: Could not set 'present' on ensure: Unable to find Keystone_tenant for name admin at 47:/etc/puppet/modules/osnailyfacter/modular/openstack-network/networks.pp
Wrapped exception:
Unable to find Keystone_tenant for name admin
Error: /Stage[main]/Main/Neutron_network[net04_ext]/ensure: change from absent to present failed: Could not set 'present' on ensure: Unable to find Keystone_tenant for name admin at 47:/etc/puppet/modules/osnailyfacter/modular/openstack-network/networks.pp

Code that fails is:
  $floating_net = 'net04_ext'

  neutron_subnet { "${floating_net}__subnet" :
    ensure => 'present',
    cidr =>'10.122.6.0/24',
    network_name => $floating_net,
    tenant_name => 'admin',
    gateway_ip => '10.122.6.1,
    enable_dhcp => false,
    allocation_pools => 'start=10.122.6.130,end=10.122.6.254',
  }

I've traced it down to https://github.com/openstack/puppet-neutron/blob/master/lib/puppet/provider/neutron.rb#L227-L229

The name returned here is 'admin::Default' which will never match 'admin'. So this breaks backwards compatibility when you upgrade between v2 and v3.

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

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

commit e7487aff3d7d5814725c33af7371d91929918517
Author: Alex Schultz <email address hidden>
Date: Thu Nov 12 16:36:25 2015 -0600

    Add workaround for v2 tenant names

    The change (https://review.openstack.org/#/c/226919/) to the naming
    convention for keystone tenants has introduced an issue with some
    neutron providers as they are no longer able to find the v2 named
    tenants since the name returned from the keystone provider now
    also includes the domain. This change adds a check to see if the name
    matches the Default domain applied by default until support for a
    resource without the domain set is removed.

    Change-Id: I4c5b6b2b663a1d08005369fa755ac03b0603102b
    Closes-Bug: #1515787

Changed in puppet-neutron:
status: New → Fix Committed
Changed in puppet-neutron:
importance: Undecided → High
Matt Fischer (mfisch)
Changed in puppet-neutron:
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.