Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

OS API was renamed to 2 from 1.1. #49

Merged
merged 2 commits into from

3 participants

@jk0

No description provided.

lib/fog/openstack/compute.rb
@@ -182,9 +182,9 @@ def authenticate
@host = uri.host
@path = uri.path
@path.sub!(/\/$/, '')
- unless @path.match(/1\.1/)
+ unless @path.match(/v2/)
@Keoven
Keoven added a note

Hi @jk0

What version of OpenStack are you using? From what we are using, keystone is still returning the one bellow for compute service:

"adminURL": "http://192.168.27.100:8774/v1.1/888ff8e2ffb44e398d85267be8b1843f",
"internalURL": "http://192.168.27.100:8774/v1.1/888ff8e2ffb44e398d85267be8b1843f",
"publicURL": "http://192.168.27.100:8774/v1.1/888ff8e2ffb44e398d85267be8b1843f",
"region": "RegionOne"

According to http://api.openstack.org/ it seems v1.1 and v2.0 are identical. I think it's best to set is to match both 1.1 and 2.

Does this change work on your environment?

@jk0
jk0 added a note

This is actually coming from the Compute API -- it was renamed to 2 from 1.1.

@Keoven
Keoven added a note

Okay, nevertheless I still think it best to match both versions given that hey should be identical. What do you think? @jk0 @hunter

@jk0
jk0 added a note

Yeah, that sound perfectly reasonable to me. I'll push up a fix.

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

Btw, looks like there may be conflicts.. github cannot merge this automatically.

@hunter

Might need to update the MorphGlobal fog repo with the latest changes before merging?

@jk0

Yup, these conflicts will go away once master is merged to the OP Pull Request.

@Keoven Keoven merged commit 4936015 into MorphGlobal:morph_merge
@Keoven

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 23, 2012
  1. @jk0

    OS API was renamed to 2 from 1.1.

    jk0 authored
Commits on Apr 25, 2012
  1. @jk0
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/fog/openstack.rb
  2. +2 −2 lib/fog/openstack/compute.rb
View
2  lib/fog/openstack.rb
@@ -97,7 +97,7 @@ def self.authenticate_v2(options, connection_options = {})
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
})
body=MultiJson.load(response.body)
-
+
if svc = body['access']['serviceCatalog'].detect{|x| x['name'] == @compute_service_name}
mgmt_url = svc['endpoints'].detect{|x| x['publicURL']}['publicURL']
token = body['access']['token']['id']
View
4 lib/fog/openstack/compute.rb
@@ -182,9 +182,9 @@ def authenticate
@host = uri.host
@path = uri.path
@path.sub!(/\/$/, '')
- unless @path.match(/1\.1/)
+ unless @path.match(/1\.1|v2/)
raise Fog::Compute::OpenStack::ServiceUnavailable.new(
- "OpenStack binding only supports version 1.1")
+ "OpenStack binding only supports version 2 (a.k.a. 1.1)")
end
@port = uri.port
@scheme = uri.scheme
Something went wrong with that request. Please try again.