Commit 0d33d2a6 authored by Antoine Millet's avatar Antoine Millet
Browse files

Queryized passwd function.

parent 239a5cad
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -105,11 +105,17 @@ class ClientHandler(OnlineCCHandler):
        self._vm_action(query, 'resume_vm')

    @listed
    def passwd(self, conn, login, password, method='ssha'):
    def passwd(self, conn, query, password, method='ssha'):
        '''
        Define a new password for specified user.
        '''
        self._server.conf.set_password(login, password, method)

        objects = self._server.list(query)
        for obj in objects:
            if 'a' not in obj:
                raise BadObjectError('All objects must have the "a" tag.')
        for obj in objects:
            self._server.conf.set_password(obj['a'], password, method)

    @listed
    def addaccount(self, conn, login, role, password=None):