Rspec-puppet can't load puppet/util/openstack

Bug #1408531 reported by Colleen Murphy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
puppet-keystone
Fix Released
Critical
Colleen Murphy

Bug Description

The recent rewrites of most of the keystone providers introduced a ruby module, Puppet::Util::Openstack that is required in the types. This is not a problem on a live system because everything in $vardir/lib is loaded after pluginsync. It's not a problem in puppet-keystone's own rspec tests because puppet-keystone's actual libdir is used rather than one of the fixture modules' libdirs. However, it causes problems when other modules need to run rspec-puppet tests against puppet-keystone. Rspec-puppet adds all of the libdirs in the spec/fixtures/modules directory as a colon-separated string to Puppet[:libdir] [1]. Puppet then appends this whole string to the $LOAD_PATH array [2]. Ruby can't actually look up files in a colon separated string, it instead searches through the $LOAD_PATH array and treats each entry as a distinct path.

The long-term solution is to patch Puppet to split the colon-separated string into individual entries. The short-term solution is to update the $LOAD_PATH in each of the keystone types prior to requiring anything in puppet/util.

[1] https://github.com/rodjek/rspec-puppet/blob/4ce0b109412f3f6e750b209a9628b79bda77b604/lib/rspec-puppet/support.rb#L145
[2] https://github.com/puppetlabs/puppet/blob/master/lib/puppet/defaults.rb#L246

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

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

Changed in puppet-keystone:
assignee: nobody → Colleen Murphy (krinkle)
status: New → In Progress
Changed in puppet-keystone:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-keystone (master)

Reviewed: https://review.openstack.org/145677
Committed: https://git.openstack.org/cgit/stackforge/puppet-keystone/commit/?id=031300546a104377623a96506b5d1b8eabc5b4c9
Submitter: Jenkins
Branch: master

commit 031300546a104377623a96506b5d1b8eabc5b4c9
Author: Colleen Murphy <email address hidden>
Date: Wed Jan 7 19:02:57 2015 -0800

    Add lib directories to $LOAD_PATH if not present

    A combination of issues with puppet and rspec-puppet make it impossible
    for rspec-puppet to properly load puppet/util/openstack when other
    modules run tests against puppet-keystone. This patch works around the
    issue by adding all directories in lib/puppet to the $LOAD_PATH prior
    to attempting to use them.

    Change-Id: I1137459c18e8645e4e8d3b8abb5f93d8b8dbab13
    Closes-bug: 1408531

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-keystone (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/145868

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-keystone (master)

Change abandoned by Richard Megginson (<email address hidden>) on branch: master
Review: https://review.openstack.org/145857
Reason: this was supposed to be on juno branch

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-keystone (stable/juno)

Change abandoned by Richard Megginson (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/145868
Reason: messed up again - try again

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-keystone (stable/juno)

Reviewed: https://review.openstack.org/145868
Committed: https://git.openstack.org/cgit/stackforge/puppet-keystone/commit/?id=726754fec68b39515a8d17b57665e35c54c42bae
Submitter: Jenkins
Branch: stable/juno

commit 726754fec68b39515a8d17b57665e35c54c42bae
Author: Colleen Murphy <email address hidden>
Date: Wed Jan 7 19:02:57 2015 -0800

    Add lib directories to $LOAD_PATH if not present

    A combination of issues with puppet and rspec-puppet make it impossible
    for rspec-puppet to properly load puppet/util/openstack when other
    modules run tests against puppet-keystone. This patch works around the
    issue by adding all directories in lib/puppet to the $LOAD_PATH prior
    to attempting to use them.

    Change-Id: I1137459c18e8645e4e8d3b8abb5f93d8b8dbab13
    Closes-bug: 1408531
    (cherry picked from commit 031300546a104377623a96506b5d1b8eabc5b4c9)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-keystone (master)

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

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

Reviewed: https://review.openstack.org/164550
Committed: https://git.openstack.org/cgit/stackforge/puppet-keystone/commit/?id=a693c1642bdafdf6f381f89089eccec78891bb1a
Submitter: Jenkins
Branch: master

commit a693c1642bdafdf6f381f89089eccec78891bb1a
Author: Sebastien Badia <email address hidden>
Date: Mon Mar 16 01:54:58 2015 +0100

    Update lib dir according recent migration

    openstack lib is now living in openstacklib in addition of keystone provider
    let's load also this path in lib dir.

    Refs:
      https://review.openstack.org/#/c/134843/
      https://review.openstack.org/#/c/161848/

    Change-Id: I597442a245dd691e1a85cf6f81b2fe68b826b87b
    Partial-Bug: #1408531

Mathieu Gagné (mgagne)
Changed in puppet-keystone:
milestone: none → 6.0.0
Matt Fischer (mfisch)
Changed in puppet-keystone:
status: Fix Committed → Fix Released
Mathieu Gagné (mgagne)
Changed in puppet-keystone:
status: Fix Released → Fix Committed
Mathieu Gagné (mgagne)
Changed in puppet-keystone:
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.