36ff035d193caeb42752394debc9f78aeaef2206gary.williams#!/usr/bin/python
36ff035d193caeb42752394debc9f78aeaef2206gary.williams
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# CDDL HEADER START
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# The contents of this file are subject to the terms of the
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Common Development and Distribution License, Version 1.0 only
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# (the "License"). You may not use this file except in compliance
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# with the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac#
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac# You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# or http://forgerock.org/license/CDDLv1.0.html.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# See the License for the specific language governing permissions
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# and limitations under the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# When distributing Covered Code, include this CDDL HEADER in each
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac# file and include the License file at legal-notices/CDDLv1_0.txt.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac# If applicable, add the following below this CDDL HEADER, with the
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac# fields enclosed by brackets "[]" replaced with your own identifying
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac# information:
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Portions Copyright [yyyy] [name of copyright owner]
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# CDDL HEADER END
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Copyright 2011 ForgeRock AS.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams
36ff035d193caeb42752394debc9f78aeaef2206gary.williamsclass person_entry:
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def __init__(self, rdn, suffix):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.userDn = '%s,ou=People,%s' \
36ff035d193caeb42752394debc9f78aeaef2206gary.williams % (rdn, suffix)
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.suffix = suffix
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr = []
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:top')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:organizationalperson')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:inetorgperson')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:person')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getDn(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.userDn
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getSuffix(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.suffix
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getAttrList(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.listAttr
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def addAttr(self, attrType, attrValue):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('%s:%s' % (attrType, attrValue))
36ff035d193caeb42752394debc9f78aeaef2206gary.williams