diff options
author | Fraser Tweedale <ftweedal@redhat.com> | 2016-12-19 14:31:14 +1000 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2017-01-11 15:26:20 +0100 |
commit | 09a65df6842411d42966111e50924df3de0b7031 (patch) | |
tree | f96b847e1a3aa7d5239d50f3438ec7d3f6f73a6a /ipaserver/plugins/ca.py | |
parent | f54df62abae4a15064bf297634558eb9be83ce33 (diff) | |
download | freeipa-09a65df6842411d42966111e50924df3de0b7031.tar.gz freeipa-09a65df6842411d42966111e50924df3de0b7031.tar.xz freeipa-09a65df6842411d42966111e50924df3de0b7031.zip |
Reuse self.api when executing ca_enabled_check
The ca_enabled_check function is a wrapper around
api.Command.ca_is_enabled. When using remote_api (e.g. during
installer), ca_enabled_check invokes the *global* api instead of the
remote_api.
Update ca_enabled_check to explicitly receive an api object from the
caller and invoke Command.ca_is_enabled through it.
Part of: https://fedorahosted.org/freeipa/ticket/2614
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins/ca.py')
-rw-r--r-- | ipaserver/plugins/ca.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ipaserver/plugins/ca.py b/ipaserver/plugins/ca.py index f02c1444f..4f24278b3 100644 --- a/ipaserver/plugins/ca.py +++ b/ipaserver/plugins/ca.py @@ -193,7 +193,7 @@ class ca_find(LDAPSearch): ) def execute(self, *keys, **options): - ca_enabled_check() + ca_enabled_check(self.api) result = super(ca_find, self).execute(*keys, **options) if not options.get('pkey_only', False): for entry in result['result']: @@ -217,7 +217,7 @@ class ca_show(LDAPRetrieve): ) def execute(self, *keys, **options): - ca_enabled_check() + ca_enabled_check(self.api) result = super(ca_show, self).execute(*keys, **options) set_certificate_attrs(result['result'], options) return result @@ -233,7 +233,7 @@ class ca_add(LDAPCreate): ) def pre_callback(self, ldap, dn, entry, entry_attrs, *keys, **options): - ca_enabled_check() + ca_enabled_check(self.api) if not ldap.can_add(dn[1:]): raise errors.ACIError( info=_("Insufficient 'add' privilege for entry '%s'.") % dn) @@ -276,7 +276,7 @@ class ca_del(LDAPDelete): msg_summary = _('Deleted CA "%(value)s"') def pre_callback(self, ldap, dn, *keys, **options): - ca_enabled_check() + ca_enabled_check(self.api) if keys[0] == IPA_CA_CN: raise errors.ProtectedEntryError( @@ -298,7 +298,7 @@ class ca_mod(LDAPUpdate): msg_summary = _('Modified CA "%(value)s"') def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): - ca_enabled_check() + ca_enabled_check(self.api) if 'rename' in options or 'cn' in entry_attrs: if keys[0] == IPA_CA_CN: @@ -314,7 +314,7 @@ class CAQuery(LDAPQuery): has_output = output.standard_value def execute(self, cn, **options): - ca_enabled_check() + ca_enabled_check(self.api) ca_id = self.api.Command.ca_show(cn)['result']['ipacaid'][0] with self.api.Backend.ra_lightweight_ca as ca_api: |