Skip to content

Conversation

@shaiguitar
Copy link

Default to using the region /cc @silvermy

@shaiguitar
Copy link
Author

This was confirmed on iam server role based instance

@geemus
Copy link
Member

geemus commented Jun 30, 2016

Could you explain the context for needing the change? Also, looks like we are getting related test failure now, could you take a look at that? Thanks!

@shaiguitar
Copy link
Author

When using :use_iam_profile => true we get a compute session with the keys for that instance's role. Since in many times this is for automation and most of the automation taking place from there would be done in the region the instance is set. It makes intuitive sense that it would default having the region set to wherever the instance is located in, which we can get from the metadata.

Can you provide some tips on figuring out the test issues? It passes locally when running the below:

shai@adsk-lappy ~/src/repos-random/fog-aws [default_region_in_iam_role] ± % be shindo tests/credentials_tests.rb
[fog][WARNING] Setting default fog timeout to 2000 seconds

  AWS | credentials (aws)
    #fetch_credentials
      + returns {:aws_access_key_id=>"dummykey", :aws_secret_access_key=>"dummysecret", :aws_session_token=>"dummytoken", :region=>"us-west-1", :aws_credentials_expire_at=>2016-06-30 14:44:16 -0700}
    #refresh_credentials_if_expired
      + returns nil
    #refresh_credentials_if_expired
      + returns true
      + returns "newkey"
    #fetch_credentials when the url 404s
[fog][WARNING] Unable to fetch credentials: Expected(200) <=> Actual(404 Not Found)
excon.error.request
  :captures            => {
    :headers => {
    }
  }
  :chunk_size          => 1048576
  :ciphers             => "HIGH:!SSLv2:!aNULL:!eNULL:!3DES"
  :connect_timeout     => 60
  :debug_request       => true
  :debug_response      => true
  :expects             => 200
  :headers             => {
    "Host"       => "169.254.169.254:80"
    "User-Agent" => "excon/0.49.0"
  }
  :host                => "169.254.169.254"
  :hostname            => "169.254.169.254"
  :idempotent          => false
  :instrumentor_name   => "excon"
  :method              => :get
  :middlewares         => [
    Excon::Middleware::ResponseParser
    Excon::Middleware::Expects
    Excon::Middleware::Idempotent
    Excon::Middleware::Instrumentor
    Excon::Middleware::Mock
  ]
  :mock                => true
  :nonblock            => true
  :omit_default_port   => false
  :path                => "/latest/meta-data/iam/security-credentials/"
  :persistent          => false
  :port                => 80
  :query               => nil
  :read_timeout        => 60
  :retries_remaining   => 4
  :retry_limit         => 4
  :scheme              => "http"
  :ssl_uri_schemes     => [
    "https"
  ]
  :ssl_verify_peer     => true
  :stubs               => :global
  :tcp_nodelay         => false
  :thread_safe_sockets => true
  :uri_parser          => URI
  :versions            => "excon/0.49.0 (x86_64-darwin14.0) ruby/2.1.7"
  :write_timeout       => 60
excon.error.response
  :body      => "not bound"
  :headers   => {
  }
  :remote_ip => "127.0.0.1"
  :status    => 404

      + returns {}

  5 succeeded in 0.552403 seconds

@geemus
Copy link
Member

geemus commented Jul 1, 2016

Thanks for explaining, looking again it looks unrelated to your changes (just in a very similar part of the codebase). I think it likely broke due to some other changes in excon actually. Will fix presently.

@geemus geemus merged commit ff675d0 into fog:master Jul 1, 2016
@geemus
Copy link
Member

geemus commented Jul 1, 2016

Thanks!

@shaiguitar
Copy link
Author

Thanks @geemus! Are there timelines of releases or can we cut a version release for this soon?

@geemus
Copy link
Member

geemus commented Jul 1, 2016

No explicit plan, I think @lanej may have cut the last few releases actually?

@shaiguitar
Copy link
Author

Great, would like to use this though it's not urgent in any way. Happy to do this myself if I could. Await ze release.

@shaiguitar
Copy link
Author

@lanej is it 🚦release time for this?

@shaiguitar shaiguitar deleted the default_region_in_iam_role branch July 11, 2016 18:19
@shaiguitar
Copy link
Author

shaiguitar commented Jul 11, 2016

@fog Can this be released please? Version

@geemus
Copy link
Member

geemus commented Jul 15, 2016

@lanej I defer to you on release? Pretty sure I haven't released this myself in a while now.

@lanej
Copy link
Member

lanej commented Jul 15, 2016

@shaiguitar
Copy link
Author

Gracias 🐫

@geemus
Copy link
Member

geemus commented Jul 15, 2016

Thanks!

On Fri, Jul 15, 2016 at 3:42 PM, Shai Rosenfeld notifications@github.com
wrote:

Gracias 🐫


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#268 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAQKg1MpIYEJm8tp0BvjLGHTUorEQgwks5qV_DBgaJpZM4JBoPX
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants