require "fog"
Dir["providers/exceptions/*.rb"].each {|file| require file }

module Provider
  class AbstractProviderConnector

    attr_accessor :connection_options, :run_list

    def create_default_server_name s
      "#{s.ssh_key}-#{s.project}-#{s.environment}-#{Time.now.to_i}"
    end

    def create_default_stack_name s
      "stack_#{s.ssh_key}-#{s.project}-#{s.environment}-#{Time.now.to_i}"
    end

    def networks_detail filters={}
      networks(filters)
    end

    def networks filters={}
      []
    end

    def security_groups filters={}
      {}
    end

    def check_node_name name

    end

    protected
    def connection_compute options
      Fog::Compute.new( options )
    end

    def connection_network options
      Fog::Network.new( options )
    end

=begin
    def configured?
      !(empty_param?(self.ssh_key) or empty_param?(self.certificate_path))
    end
=end
    def server_tags server
    end

    def stack_tags stack
    end

    def empty_param? param
      param.nil? or param.empty?
    end

    def set_tags instance_id, tags
    end

    def unset_tags instance_id, tags
    end

    def set_server_tags server
    end

    def set_stack_tags stack, out=""
    end

    def stack_events(stack)
      []
    end

  end
end
