def remove(self, username, user_api, filename=None, force=False):
        """Remove specified SSH public key from specified user."""
        self.keys = API.__get_keys(filename)
        self.username = username
        user = user_api.find(username)[0]

        if not force:  # pragma: no cover
            self.__confirm()

        for key in self.__delete_keys():
            operation = {'sshPublicKey': [(ldap3.MODIFY_DELETE, [key])]}
            self.client.modify(user.entry_dn, operation)
def remove ( self , username , user_api , filename = None , force = False ) : self . keys = API . __get_keys ( filename ) self . username = username user = user_api . find ( username ) [ 0 ] if not force : self . __confirm ( ) for key in self . __delete_keys ( ) : operation = { 'sshPublicKey' : [ ( ldap3 . MODIFY_DELETE , [ key ] ) ] } self . client . modify ( user . entry_dn , operation )
Remove specified SSH public key from specified user.