def rename(name, new_name):
    current_info = info(name)
    if not current_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    new_info = info(new_name)
    if new_info:
        raise CommandExecutionError(
            'User \'{0}\' already exists'.format(new_name)
        )
    cmd = ['pw', 'usermod', '-l', new_name, '-n', name]
    __salt__['cmd.run'](cmd)
    post_info = info(new_name)
    if post_info['name'] != current_info['name']:
        return post_info['name'] == new_name
    return False
Invalidate coupons that are past their redeem date.
dataset/ETHPy150Open saltstack/salt/salt/modules/pw_user.py/rename--crossover with--dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/blueprints/billing/tasks.py/expire_old_coupons