module Fog
  module Account
    def self.[](provider)
      new(:provider => provider)
    end

    def self.new(attributes)
      attributes = attributes.dup
      provider = attributes.delete(:provider).to_s.downcase.to_sym

      if provider == :stormondemand
        require "fog/account/storm_on_demand"
        Fog::Account::StormOnDemand.new(attributes)
      else
        raise ArgumentError, "#{provider} has no account service"
      end
    end

    def self.providers
      Fog.services[:account]
    end
  end
end

module Fog
  module Account
    def self.[](provider)
      new(:provider => provider)
    end

    def self.new(attributes)
      attributes = attributes.dup
      provider = attributes.delete(:provider).to_s.downcase.to_sym

      if provider == :stormondemand
        require "fog/account/storm_on_demand"
        Fog::Account::StormOnDemand.new(attributes)
      else
        raise ArgumentError, "#{provider} has no account service"
      end
    end

    def self.providers
      Fog.services[:account] || []
    end
  end
end

Fix error in provider listing
Fix error in provider listing

This bug exists for all providers but due to StormOnDemand not actually
registering itself, this causes a problem with upstream tests.

When `Fog.services` does not have a registered service, it returns `nil`
not the expected `Array` of providers.

This is due to be refactored for all services shortly.
