def _lockEnt(self, password_attr, ent):
    password = ent[password_attr][0]
    if ('{CRYPT}' not in password):
        raise RuntimeError
    password = password.replace('{CRYPT}!', '{CRYPT}')
    password = password.replace('{CRYPT}', '{CRYPT}!')
    ent[password_attr] = password
    ent.save()
def _lockEnt(self, password_attr, ent):
    password = ent[password_attr][0]
    if ('{CRYPT}' not in password):
        raise RuntimeError
    password = password.replace('{CRYPT}!', '{CRYPT}')
    password = password.replace('{CRYPT}', '{CRYPT}!')
    ent[password_attr] = password
    ent.save()