def _setpassEnt(self, password_attr, ent, password, use_crypt):
    if (not use_crypt):
        pass
    if (password_attr not in ent):
        ent[password_attr] = [None]
    if (len(ent[password_attr]) == 1):
        ent[password_attr] = [('{CRYPT}' + password)]
    elif (len(ent[password_attr]) == 2):
        ent[password_attr][1] = ('{CRYPT}' + password)
    else:
        raise Exception('What ?')
    ent.save()
def _setpassEnt(self, password_attr, ent, password, use_crypt):
    if (not use_crypt):
        pass
    if (password_attr not in ent):
        ent[password_attr] = [None]
    if (len(ent[password_attr]) == 1):
        ent[password_attr] = [('{CRYPT}' + password)]
    elif (len(ent[password_attr]) == 2):
        ent[password_attr][1] = ('{CRYPT}' + password)
    else:
        raise Exception('What ?')
    ent.save()