Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

add support for HP availability zone az-3.region-a.geo-1 #903

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

mattray commented May 11, 2012

missing from the 'HP' provider in Fog.

Member

rupakg commented May 12, 2012

Will do in my next update.

ngeren commented Nov 6, 2012

You can use this monkey patch until an actual fix is committed. Not only does it support az-3, but it's order agnostic, where-as the existing implementation expects az-1..3 to be in a specific order. This puppy will work regardless of the object order sent back in the auth response from HP:

module Fog
  module HP

    class << self
      alias :original_get_endpoint_from_catalog :get_endpoint_from_catalog      
      def get_endpoint_from_catalog(service_catalog, service_type, avl_zone)
        regions = { :az1 => "az-1.region-a.geo-1", :az2 => "az-2.region-a.geo-1", :az3 => "az-3.region-a.geo-1" }
        if service_catalog
          service_item = service_catalog.select {|s| s["type"] == service_type}.first
          if service_item then
            endpoints = service_item[ "endpoints" ]
            if !endpoints.nil? then
              endpoint_url = nil
              endpoints.each do |ep|
                region = regions[ avl_zone ]
                if ep[ "region" ].eql?( regions[ avl_zone ] ) then
                  endpoint_url = ep[ "publicURL" ]
                end
                return endpoint_url if !endpoint_url.nil?
              end
            end
          end
          raise "Unable to retrieve endpoint service url from service catalog." if endpoint_url.nil?
        else
          raise "Unable to parse service catalog."
        end
      end
    end

  end
end
Owner

geemus commented Nov 9, 2012

@ngeren - thanks for the update, hopefully we can get the updated stuff soon.

Member

rupakg commented Jan 25, 2013

Fixed in #1505. /cc @ngeren @mattray

@rupakg rupakg closed this Jan 25, 2013

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