'Modifies the keypair associated with a specified instance.
Once the modification is done, you must restart the instance.
:param      instance_id: The ID of the instance
:type       instance_id: ``string``
:param      key_name: The name of the keypair
:type       key_name: ``string``'

def ex_modify_instance_keypair(self, instance_id, key_name=None):

    params = {'Action': 'ModifyInstanceKeypair'}
    params.update({'instanceId': instance_id})
    if (key_name is not None):
        params.update({'keyName': key_name})
    response = self.connection.request(self.path, params=params, method='GET').object
    return (findtext(element=response, xpath='return', namespace=OUTSCALE_NAMESPACE) == 'true')
