Chef Metal Destroying Instances - undefined local variable or method `iam_endpoint'


#1

I’m trying to destroy (delete? some docs say it’s ‘destroy’ while other say
’delete’) EC2 instances started with chef-metal.

Here’s the destroy recipe, pretty simple:

require 'chef_metal’
with_chef_server “https://chef01.prod.slicetest.com:443”, {
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
}
machine “mongo-cfg01.dev-volatile.slicetest.com” do
action :destroy
end

and here’s what I get when I run it:

================================================================================
Error executing action destroy on resource ‘machine[
mongo-cfg01.dev-volatile.slicetest.com]’

NameError

undefined local variable or method `iam_endpoint’ for
ChefMetalFog::Providers::AWS:Class

Resource Declaration:

In /Users/doug/git/chef/chef-metal/mongo-dev-volatile-down.rb

9: machine “mongo-cfg01.dev-volatile.slicetest.com” do
10: action :destroy
11: end
12: #end

Can’t get much simpler than that. What am I doing wrong?

Doug


#2

No takers? :frowning:

Doug.

On Thu, Oct 16, 2014 at 9:00 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

I’m trying to destroy (delete? some docs say it’s ‘destroy’ while other
say ‘delete’) EC2 instances started with chef-metal.

Here’s the destroy recipe, pretty simple:

require 'chef_metal’
with_chef_server “https://chef01.prod.slicetest.com:443”, {
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
}
machine “mongo-cfg01.dev-volatile.slicetest.com” do
action :destroy
end

and here’s what I get when I run it:

================================================================================
Error executing action destroy on resource ‘machine[
mongo-cfg01.dev-volatile.slicetest.com]’

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

NameError

undefined local variable or method `iam_endpoint’ for
ChefMetalFog::Providers::AWS:Class

Resource Declaration:

In /Users/doug/git/chef/chef-metal/mongo-dev-volatile-down.rb

9: machine “mongo-cfg01.dev-volatile.slicetest.com” do
10: action :destroy
11: end
12: #end

Can’t get much simpler than that. What am I doing wrong?

Doug


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#3

Doug,

Would you mind opening a GitHub ticket for either chef-metal or the driver
that you’re using (whichever fits better, which in this case seems to be
the fog driver)? That way we can prioritize and keep better track of it .

-John

John Ewart - Sr. Software Engineer

jewart@getchef.com – *my: *Linkedin http://www.linkedin.com/in/johnwewart
Twitter http://www.twitter.com/soysamurai

CHEF

GETCHEF.COM http://www.getchef.com/

TM

getchef.com http://www.getchef.com/ Blog
http://www.opscode.com/blog/ Facebook
https://www.facebook.com/getchefdotcom Twitter
https://twitter.com/chef Youtube https://www.youtube.com/getchef

On Mon, Oct 20, 2014 at 9:41 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

No takers? :frowning:

Doug.

On Thu, Oct 16, 2014 at 9:00 AM, Douglas Garstang <doug.garstang@gmail.com

wrote:

I’m trying to destroy (delete? some docs say it’s ‘destroy’ while other
say ‘delete’) EC2 instances started with chef-metal.

Here’s the destroy recipe, pretty simple:

require 'chef_metal’
with_chef_server “https://chef01.prod.slicetest.com:443”, {
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
}
machine “mongo-cfg01.dev-volatile.slicetest.com” do
action :destroy
end

and here’s what I get when I run it:

================================================================================
Error executing action destroy on resource ‘machine[
mongo-cfg01.dev-volatile.slicetest.com]’

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

NameError

undefined local variable or method `iam_endpoint’ for
ChefMetalFog::Providers::AWS:Class

Resource Declaration:

In /Users/doug/git/chef/chef-metal/mongo-dev-volatile-down.rb

9: machine “mongo-cfg01.dev-volatile.slicetest.com” do
10: action :destroy
11: end
12: #end

Can’t get much simpler than that. What am I doing wrong?

Doug


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#4

It looks like a bug in the code, have you looked at that provider? It references iam_endpoint[0] but only default_iam_endpoint is defined in that method. If I’m reading it right, you can make it use the right endpoint by setting AWS_IAM_URL.

You should open an issue[1], ideally attempt fixing it yourself. The code is open source, you’re welcome to contribute something back.

[0] https://github.com/opscode/chef-metal-fog/blob/master/lib/chef_metal_fog/providers/aws.rb#L175
[1] https://github.com/opscode/chef-metal#bugs-and-the-plan

On Monday, October 20, 2014 at 9:41 AM, Douglas Garstang wrote:

No takers? :frowning:

Doug.

On Thu, Oct 16, 2014 at 9:00 AM, Douglas Garstang <doug.garstang@gmail.com (mailto:doug.garstang@gmail.com)> wrote:

I’m trying to destroy (delete? some docs say it’s ‘destroy’ while other say ‘delete’) EC2 instances started with chef-metal.

Here’s the destroy recipe, pretty simple:

require 'chef_metal’
with_chef_server “https://chef01.prod.slicetest.com:443”, {
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
}
machine “mongo-cfg01.dev-volatile.slicetest.com (http://mongo-cfg01.dev-volatile.slicetest.com)” do
action :destroy
end

and here’s what I get when I run it:

================================================================================
Error executing action destroy on resource ‘machine[mongo-cfg01.dev-volatile.slicetest.com (http://mongo-cfg01.dev-volatile.slicetest.com)]’

NameError

undefined local variable or method `iam_endpoint’ for ChefMetalFog::Providers::AWS:Class

Resource Declaration:

In /Users/doug/git/chef/chef-metal/mongo-dev-volatile-down.rb

9: machine “mongo-cfg01.dev-volatile.slicetest.com (http://mongo-cfg01.dev-volatile.slicetest.com)” do
10: action :destroy
11: end
12: #end

Can’t get much simpler than that. What am I doing wrong?

Doug


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com (mailto:doug.garstang@gmail.com)
Cell: +1-805-340-5627


#5

John,

Opened an issue:

Would attempt to fix it myself but I can honestly say that after 16 years
in the business, ruby is about the hardest language I’ve ever had to learn.
If it was in python or something I’d take a stab at it. Not rubishing
ruby… ruby and I just don’t get along.

Doug.

On Mon, Oct 20, 2014 at 9:50 AM, Daniel Condomitti daniel@condomitti.com
wrote:

It looks like a bug in the code, have you looked at that provider? It
references iam_endpoint[0] but only default_iam_endpoint is defined in that
method. If I’m reading it right, you can make it use the right endpoint by
setting AWS_IAM_URL.

You should open an issue[1], ideally attempt fixing it yourself. The code
is open source, you’re welcome to contribute something back.

[0]
https://github.com/opscode/chef-metal-fog/blob/master/lib/chef_metal_fog/providers/aws.rb#L175
[1] https://github.com/opscode/chef-metal#bugs-and-the-plan

On Monday, October 20, 2014 at 9:41 AM, Douglas Garstang wrote:

No takers? :frowning:

Doug.

On Thu, Oct 16, 2014 at 9:00 AM, Douglas Garstang <doug.garstang@gmail.com

wrote:

I’m trying to destroy (delete? some docs say it’s ‘destroy’ while other
say ‘delete’) EC2 instances started with chef-metal.

Here’s the destroy recipe, pretty simple:

require 'chef_metal’
with_chef_server “https://chef01.prod.slicetest.com:443”, {
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
}
machine “mongo-cfg01.dev-volatile.slicetest.com” do
action :destroy
end

and here’s what I get when I run it:

================================================================================
Error executing action destroy on resource ‘machine[
mongo-cfg01.dev-volatile.slicetest.com]’

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

NameError

undefined local variable or method `iam_endpoint’ for
ChefMetalFog::Providers::AWS:Class

Resource Declaration:

In /Users/doug/git/chef/chef-metal/mongo-dev-volatile-down.rb

9: machine “mongo-cfg01.dev-volatile.slicetest.com” do
10: action :destroy
11: end
12: #end

Can’t get much simpler than that. What am I doing wrong?

Doug


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627