diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-01-24 10:46:44 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-01-24 14:35:11 -0500 |
commit | 678c764d408856dc6a71d7fda92611bef96a22a2 (patch) | |
tree | 3b339b25d9bee3fbaf131d0171ba9b7f23cbda29 /ipalib/plugins/host.py | |
parent | 96469fbc886bb53a898396ad030a48609f147160 (diff) | |
download | freeipa-678c764d408856dc6a71d7fda92611bef96a22a2.tar.gz freeipa-678c764d408856dc6a71d7fda92611bef96a22a2.tar.xz freeipa-678c764d408856dc6a71d7fda92611bef96a22a2.zip |
Make a copy of objectclasses so a call can't update them globally.
In the host plugin we may change the default objectclasses based on
the options selected. This was affecting it globally and causing
subsequent calls to fail.
Diffstat (limited to 'ipalib/plugins/host.py')
-rw-r--r-- | ipalib/plugins/host.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index 6947d9077..3225a78ab 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -323,15 +323,15 @@ class host_add(LDAPCreate): entry_attrs['krbprincipalname'] = 'host/%s@%s' % ( keys[-1], self.api.env.realm ) + if 'krbprincipalaux' not in entry_attrs: + entry_attrs['objectclass'].append('krbprincipalaux') if 'krbprincipal' not in entry_attrs: entry_attrs['objectclass'].append('krbprincipal') - if 'krbprincipal' not in entry_attrs: - entry_attrs['objectclass'].append('krbprincipalaux') else: - if 'krbprincipal' in entry_attrs['objectclass']: - entry_attrs['objectclass'].remove('krbprincipal') if 'krbprincipalaux' in entry_attrs['objectclass']: entry_attrs['objectclass'].remove('krbprincipalaux') + if 'krbprincipal' in entry_attrs['objectclass']: + entry_attrs['objectclass'].remove('krbprincipal') if 'random' in options: if options.get('random'): entry_attrs['userpassword'] = ipa_generate_password() |