0

I'm mucking about with the Fog gem and have figured out how to get started:

1.9.3-p545 :008 > c = Fog::Compute::Ecloud.new({
1.9.3-p545 :009 >       :base_path => '/cloudapi/spec',
1.9.3-p545 :010 >       ecloud_authentication_method: 'basic_auth',
1.9.3-p545 :011 >       ecloud_username: 'user@terremark.com',
1.9.3-p545 :012 >       ecloud_password: 'password'
1.9.3-p545 :013?>     })
[fog][WARNING] Unrecognized arguments: base_path
 => #<Fog::Compute::Ecloud::Real:25681720 @base_path="/cloudapi/spec" @connections={} @connection_options={} @host="https://services.enterprisecloud.terremark.com" @persistent=false @version="2013-06-01" @authentication_method=:basic_auth @access_key=nil @private_key=nil @username="user@terremark.com" @password="password"> 

I don't know what to do after this, though. How do I get the object to do anything useful? I'm new to Ruby so a lot of the code in the Fog Ecloud source doesn't make sense to me.

I've tried using different methods, but each tends to result in an error.

Can someone provide an example and explanation indicating where I need to go from here?

theillien
  • 1,189
  • 3
  • 19
  • 33

1 Answers1

4

It looks like you have found a bug!

Fog is giving you this error because base_url is not present in the recognizes line.

I went ahead and fixed it for you. If you are using bundler you can use the latest master by updating your Gemfile to include the following

gem 'fog', :git => 'https://github.com/fog/fog.git'

Or alternatively you can just patch it in your code by executing the following code prior to using fog

require 'fog'
module Fog
  module Compute
    class Ecloud < Fog::Service
      recognizes :ecloud_username, :ecloud_password, :ecloud_version,
                 :ecloud_access_key, :ecloud_private_key,
                 :ecloud_authentication_method, :base_path 
    end
  end
end

For information about how to use fog, I would recommend reading the following page.

Kyle Rames
  • 398
  • 2
  • 5
  • Yup, that fixed it. I had previously looked at the page you linked to. Unfortunately, as new as I am to Ruby and with as little documentation for the ecloud provider as there is, I'm not able to piece together how to move forward. I can sort out the methods available with `c.methods`, but when I attempt to execute one I get `ArgumentError: wrong number of argumetns (# for #)`. How do I sort out which arguments are necessary for each method? It's all rather confusing and that webpage only provides a very brief synopsis while the ecloud provider has pretty much no documentation. – theillien Mar 30 '14 at 02:46
  • Additionally, utilizing the interactive `fog` shell doesn't help because neither `ecloud` nor `terremark` are recognized providers. – theillien Mar 30 '14 at 03:03