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.data[:key_fingerprint] if response[:key_material] options[:private_key] = response.data[:key_material] end KeyPair.new(response.key_name, options.merge(:config => config)) end