Bug #11959

Puppet.warn should be Puppet.warning

Added by Gary Larizza 4 months ago. Updated 4 months ago.

Status:Merged - Pending Release Start date:01/14/2012
Priority:Normal Due date:
Assignee:Gary Larizza % Done:

0%

Category:cloudpack Spent time: -
Target version:-
Keywords: Branch:https://github.com/puppetlabs/puppetlabs-cloud-provisioner/pull/71
Votes: 0

Description

When launching an EC2 instance with the Cloud Provisioner this weekend, I noticed the following:

>> require 'puppet/face'
=> true
>> arguments = { 'image' => 'ami-1bd68a5e', 'keyname' => 'gary_test', 'type' => 't1.micro', 'region' => 'us-west-1' }
=> {"region"=>"us-west-1", "keyname"=>"gary_test", "type"=>"t1.micro", "image"=>"ami-1bd68a5e"}
>> ec2_ip = Puppet::Face[:node_aws, :current].create(arguments)
#######################
=> "ec2-184-72-21-49.us-west-1.compute.amazonaws.com"
>> install_args = { 'login' => 'ec2-user', 'keyfile' => '/Users/gary/Dropbox/AWS Credentials/gary_test.pem', 'install_script' => 'puppet-enterprise-http', 'installer_payload' => 'http://pm.puppetlabs.com/puppet-enterprise/2.0/puppet-enterprise-2.0-el-6-x86_64.tar.gz', 'installer_answers' => '/Users/gary/Desktop/Writeups/pe-answers-agent.txt' }
=> {"installer_payload"=>"http://pm.puppetlabs.com/puppet-enterprise/2.0/puppet-enterprise-2.0-el-6-x86_64.tar.gz", "keyfile"=>"/Users/gary/Dropbox/AWS Credentials/gary_test.pem", "install_script"=>"puppet-enterprise-http", "login"=>"ec2-user", "installer_answers"=>"/Users/gary/Desktop/Writeups/pe-answers-agent.txt"}
>> install_node = Puppet::Face[:node, :current].install(ec2_ip, install_args)   
NoMethodError: private method `warn' called for Puppet:Module
    from /Users/gary/.puppet/modules/cloud_provisioner/lib/puppet/cloudpack.rb:834:in `install'
    from /Users/gary/.puppet/modules/cloud_provisioner/lib/puppet/face/node/install.rb:21:in `install implementation, required on Ruby 1.8'
    from /Library/Ruby/Site/1.8/puppet/interface/action.rb+eval[wrapper]:203:in `__send__'
    from /Library/Ruby/Site/1.8/puppet/interface/action.rb+eval[wrapper]:203:in `install'
    from (irb):5

Looks like it’s trying to call Puppet.warn instead of using Puppet.warning. Note that it still INSTALLS Puppet Enterprise:

┌(8643) [gary@Garys-MBP] [puppet: 2.7.9] [ ] [255]
└(~)▷ ssh -i /Users/gary/Dropbox/AWS\ Credentials/gary_test.pem ec2-user@ec2-184-72-21-49.us-west-1.compute.amazonaws.com
Last login: Sun Jan 15 02:47:24 2012 from c-76-27-243-28.hsd1.or.comcast.net

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

See /usr/share/doc/system-release/ for latest release notes.
There are 18 security update(s) out of 26 total update(s) available
[ec2-user@ip-10-166-185-220 ~]$ which puppet
/usr/local/bin/puppet
[ec2-user@ip-10-166-185-220 ~]$ puppet config print certname
ip-10-166-185-220.us-west-1.compute.internal
[ec2-user@ip-10-166-185-220 ~]$ cat /tmp/b910fcea-be58-d02f-d02d-ad20913131bb/install.log 
================================================================================

Puppet Enterprise v2.0.0 installer
for el-6-x86_64

--------------------------------------------------------------------------------

< --snip-->

STEP 5: DONE

Thanks for installing Puppet Enterprise!
   Puppet Enterprise has been installed to "/opt/puppet," and its
   configuration files are located in "/etc/puppetlabs".
## Answers from this session saved to 'puppet-enterprise/answers.lastrun'

================================================================================

History

Updated by Gary Larizza 4 months ago

Yeah, changing line 834 to:

Puppet.warning "Could not determine the remote puppet agent certificate name using #{certname_command}"

Allows it to run.

>> require 'puppet/face'
=> true
>> arguments = { 'image' => 'ami-1bd68a5e', 'keyname' => 'gary_test', 'type' => 't1.micro', 'region' => 'us-west-1' }
=> {"region"=>"us-west-1", "keyname"=>"gary_test", "type"=>"t1.micro", "image"=>"ami-1bd68a5e"}
>> ec2_ip = Puppet::Face[:node_aws, :current].create(arguments)
#########################################################################################################################################
=> "ec2-50-18-241-83.us-west-1.compute.amazonaws.com"
>> install_args = { 'login' => 'ec2-user', 'keyfile' => '/Users/gary/Dropbox/AWS Credentials/gary_test.pem', 'install_script' => 'puppet-enterprise-http', 'installer_payload' => 'http://pm.puppetlabs.com/puppet-enterprise/2.0/puppet-enterprise-2.0-el-6-x86_64.tar.gz', 'installer_answers' => '/Users/gary/Desktop/Writeups/pe-answers-agent.txt' }
=> {"installer_payload"=>"http://pm.puppetlabs.com/puppet-enterprise/2.0/puppet-enterprise-2.0-el-6-x86_64.tar.gz", "keyfile"=>"/Users/gary/Dropbox/AWS Credentials/gary_test.pem", "install_script"=>"puppet-enterprise-http", "login"=>"ec2-user", "installer_answers"=>"/Users/gary/Desktop/Writeups/pe-answers-agent.txt"}
>> install_node = Puppet::Face[:node, :current].install(ec2_ip, install_args)   
=> {"puppetagent_certname"=>nil, "status"=>"success"}

Updated by Gary Larizza 4 months ago

  • Branch set to https://github.com/puppetlabs/puppetlabs-cloud-provisioner/pull/72

Updated by Gary Larizza 4 months ago

  • Branch changed from https://github.com/puppetlabs/puppetlabs-cloud-provisioner/pull/72 to https://github.com/puppetlabs/puppetlabs-cloud-provisioner/pull/71

Updated by Kelsey Hightower 4 months ago

  • Category set to cloudpack
  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Assignee set to Gary Larizza

Updated by Brenden Grace 4 months ago

We are evaluating PE 2.0.2 and are running into this problem when we try to use node install. Any way we can patch our 2.0.2 tarball so that we can continue our eval?

puppet node install --install-script puppet-enterprise --installer-payload /puppet/pe/puppet-enterprise-2.0.2-ubuntu-10.04-amd64.tar.gz ...
...
notice: Waiting for SSH response ...
notice: Waiting for SSH response ... Done
notice: Uploading Puppet Enterprise tarball ...
notice: Uploading Puppet Enterprise tarball ... Done
notice: Installing Puppet ...
err: private method `warn' called for Puppet:Module
err: Try 'puppet help node install' for usage

Updated by James Turnbull 4 months ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

Reviewed and merged.

Updated by James Turnbull 4 months ago

To fix this for your 2.0.2 evaluation patch the file:

/opt/puppet/lib/site_ruby/1.8/puppet/cloudpack.rb

With this patch: https://github.com/puppetlabs/puppetlabs-cloud-provisioner/commit/8150d3135ee49f62a75fa304594d98d511d9e46c.patch

Also available in: Atom PDF