Merge "Properly handle emulated ldap enablement"

This commit is contained in:
Jenkins 2013-03-20 21:36:08 +00:00 committed by Gerrit Code Review
commit aa30b5132b
2 changed files with 14 additions and 19 deletions

View File

@ -496,19 +496,20 @@ class EnabledEmuMixIn(BaseLdap):
return bool(enabled_value) return bool(enabled_value)
def _add_enabled(self, object_id): def _add_enabled(self, object_id):
conn = self.get_connection() if not self._get_enabled(object_id):
modlist = [(ldap.MOD_ADD, conn = self.get_connection()
'member', modlist = [(ldap.MOD_ADD,
[self._id_to_dn(object_id)])] 'member',
try: [self._id_to_dn(object_id)])]
conn.modify_s(self.enabled_emulation_dn, modlist) try:
except ldap.NO_SUCH_OBJECT: conn.modify_s(self.enabled_emulation_dn, modlist)
attr_list = [('objectClass', ['groupOfNames']), except ldap.NO_SUCH_OBJECT:
('member', attr_list = [('objectClass', ['groupOfNames']),
[self._id_to_dn(object_id)])] ('member',
if self.use_dumb_member: [self._id_to_dn(object_id)])]
attr_list[1][1].append(self.dumb_member) if self.use_dumb_member:
conn.add_s(self.enabled_emulation_dn, attr_list) attr_list[1][1].append(self.dumb_member)
conn.add_s(self.enabled_emulation_dn, attr_list)
def _remove_enabled(self, object_id): def _remove_enabled(self, object_id):
conn = self.get_connection() conn = self.get_connection()

View File

@ -92,9 +92,3 @@ class LiveLDAPIdentity(test_backend_ldap.LDAPIdentity):
def test_user_enable_attribute_mask(self): def test_user_enable_attribute_mask(self):
raise nose.exc.SkipTest('Test is for Active Directory Only') raise nose.exc.SkipTest('Test is for Active Directory Only')
def test_configurable_allowed_project_actions(self):
raise nose.exc.SkipTest('Blocked by bug 1155234')
def test_project_crud(self):
raise nose.exc.SkipTest('Blocked by bug 1155234')