def create(cloud_name, options)
      raise ArgumentError.new("cloud_name is required") if cloud_name.to_s.empty?
      raise ArgumentError.new("options[:logger] is required") unless logger = options[:logger]
      raise UnknownCloud.new("No cloud definitions available.") unless @names_to_script_paths
      cloud_name = cloud_name.to_sym
      cloud_name = default_cloud_name if UNKNOWN_CLOUD_NAME == cloud_name
      raise UnknownCloud.new("Unable to determine a default cloud") if UNKNOWN_CLOUD_NAME == cloud_name
      cloud_script_path = registered_script_path(cloud_name)
      options = options.dup
      options[:name] ||= cloud_name.to_s
      options[:script_path] = cloud_script_path

      cloud = nil
      begin
        require cloud_script_path
        cloud_classname = cloud_name.to_s.capitalize
        cloud_class = eval("RightScale::Clouds::#{cloud_classname}")
        cloud = cloud_class.new(options)
      rescue LoadError => e
        raise ArgumentError, "Could not load Cloud class for #{cloud_name}, #{e}"
      end

      extend_cloud_by_scripts(cloud, logger)

      return cloud
    end
def create(cloud_name, options)
      raise ArgumentError.new("cloud_name is required") if cloud_name.to_s.empty?
      raise ArgumentError.new("options[:logger] is required") unless logger = options[:logger]
      raise UnknownCloud.new("No cloud definitions available.") unless @names_to_script_paths
      cloud_name = cloud_name.to_sym
      cloud_name = default_cloud_name if UNKNOWN_CLOUD_NAME == cloud_name
      raise UnknownCloud.new("Unable to determine a default cloud") if UNKNOWN_CLOUD_NAME == cloud_name
      cloud_script_path = registered_script_path(cloud_name)
      options = options.dup
      options[:name] ||= cloud_name.to_s
      options[:script_path] = cloud_script_path

      cloud = nil
      begin
        require cloud_script_path
        cloud_classname = cloud_name.to_s.capitalize
        cloud_class = eval("RightScale::Clouds::#{cloud_classname}")
        cloud = cloud_class.new(options)
      rescue LoadError => e
        raise ArgumentError, "Could not load Cloud class for #{cloud_name}, #{e}"
      end

      extend_cloud_by_scripts(cloud, logger)

      return cloud
    end
Factory method for dynamic metadata types.

 === Parameters
 cloud(String):: a registered_type cloud name
 options(Hash):: options for creation

 === Return
 result(Object):: new instance of registered_type metadata type

 === Raise
 UnknownCloud:: on error