def create_user_policy(inst, basedn, log, args): log = log.getChild('create_user_policy') pwp_manager = PwPolicyManager(inst) attrs = _args_to_attrs(args, pwp_manager.arg_to_attr) pwp_manager.create_user_policy(args.DN[0], attrs) print('Successfully created user password policy')
def password_policy(topology_st, create_user): """Set up password policy for subtree and user""" pwp = PwPolicyManager(topology_st.standalone) policy_props = {} log.info('Create password policy for subtree {}'.format(OU_PEOPLE)) pwp.create_subtree_policy(OU_PEOPLE, policy_props) log.info('Create password policy for user {}'.format(TEST_USER_DN)) pwp.create_user_policy(TEST_USER_DN, policy_props)