class AWS::EC2::KeyPairCollection

def create_or_import client_method, options

def create_or_import client_method, options
  # stringify option values
  options = options.inject({}) {|h,v| h[v.first] = v.last.to_s; h }
  response = client.send(client_method, options)
  options = {}
  options[:fingerprint] = response.key_fingerprint
  if response.respond_to?(:key_material)
    options[:private_key] = response.key_material
  end
  KeyPair.new(response.key_name, options)
end