The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #13682

Puppet should not conflict with released puppet-module Gem

Added by Anonymous about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:04/08/2012
Priority:NormalDue date:
Assignee:Matthaus Owens% Done:

0%

Category:compatibility
Target version:2.7.14
Affected Puppet version:2.7.12 Branch:https://github.com/puppetlabs/puppet/pull/641
Keywords:constants ARTIFACTS puppet-module REPOSITORY_URL namespace

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

Overview

The current behavior of Puppet 2.7.x (2.7.12-99-g8ceaaf0) declares some constants which conflicts with the already released puppet-module gem. Since the released gem requires Puppet, they fight with each other over these constants.

Impact data

All module authors are affected by this since they will need to do a knife-edge cut over from the existing module tool to Puppet 2.7.12, or choose not to upgrade Puppet beyond 2.7.10.

Steps to reproduce

Use the existing puppet-module gem to build a package with Puppet 2.7.x. These conflicts become evident:

/vagrant/src/puppet/lib/puppet/module_tool.rb:14: warning: already initialized constant ARTIFACTS
/vagrant/src/puppet/lib/puppet/module_tool.rb:16: warning: already initialized constant REPOSITORY_URL

I should be able to fix this quickly, so I’m assigning it to myself.


Related issues

Related to Puppet - Feature #14149: The Puppet::Modules (or some other namespace) should be r... Closed 04/23/2012

History

#1 Updated by Anonymous about 4 years ago

  • Assignee deleted (Anonymous)

Additional information

I know I said I thought this was actually my misunderstanding in another channel, but after spending some more time on the issue, we do have the conflict, just in Puppet::Module::Tool and not the global namespace like I originally thought.

If you try and use the puppet-module tool instead of puppet module then Puppet will monkey patch the existing Gem implementation.

Puppet re-opens the Puppet::Module::Tool module, causing this problem.

#2 Updated by Anonymous about 4 years ago

  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/641

#3 Updated by Anonymous about 4 years ago

Hrm. Feels to me like this is the wrong direction to approach this from. The problem is that we have trouble if the gem is installed and RubyGems are active, right?

Much better that we push people to do the right thing, which is uninstall the gem now they have the real deal installed.

That can be checked by using the gem system to figure out if the problem code is installed; that requires:

def gem_available?(name)
   Gem::Specification.find_by_name(name)
rescue Gem::LoadError
   false
rescue
   Gem.available?(name)
end

…and then you can cleanly and politely fail instead.

#4 Updated by Anonymous about 4 years ago

Daniel Pittman wrote:

Hrm. Feels to me like this is the wrong direction to approach this from. The problem is that we have trouble if the gem is installed and RubyGems are active, right?

Much better that we push people to do the right thing, which is uninstall the gem now they have the real deal installed.

That can be checked by using the gem system to figure out if the problem code is installed; that requires:

[…]

…and then you can cleanly and politely fail instead.

I responded in the Github pull request discussion.

-Jeff

#5 Updated by Anonymous about 4 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Assignee set to Matthaus Owens
  • Target version changed from 2.7.x to 2.7.14

Haus, your call if you’d like to cherry pick the patches into the RC branch for 2.7.14 or wait until 2.7.15. From our discussion today it sounds like 2.7.14 which is why I set the target version to 2.7.14.

-Jeff

#6 Updated by Anonymous about 4 years ago

Merged into 2.7.x

(Note, didn’t merge into the 2.7rc branch.)

As: https://github.com/puppetlabs/puppet/commit/d0d34a7

commit d0d34a7fac3188305752b1056119b5ad1f8d496a (from 0ee259f3c26608ba58afe5fbd5bb6f6489c0cefb)
Merge: 0ee259f 42b20be
Author: Jeff McCune 
Date:   Mon Apr 23 16:25:21 2012 -0700

    Merge branch 'ticket/2.7.x/13682_puppet_should_not_conflict_with_released_puppet-module_gem' into 2.7.x
    
    * ticket/2.7.x/13682_puppet_should_not_conflict_with_released_puppet-module_gem:
      (#13682) Fix acceptance test failures
      (#13682) Rename Puppet::Module::Tool to Puppet::ModuleTool
      (maint) Ensure every file has a trailing newlines
    
    Reviewed-by: Daniel Pittman
    Reviewed-by: Matthaus Litteken
    Reviewed-by: Kelsey Hightower

#7 Updated by Moses Mendoza about 4 years ago

  • Status changed from Merged - Pending Release to Closed

Released in 2.7.14rc3

Also available in: Atom PDF