#3090 `api` is a singleton
Closed: Fixed None Opened 11 years ago by pviktori.

We use a global api object. It's possible to create a second one, but it's not possible to load plugins to it.

A second api object would be useful in ipa-replica-install -- we could have one for the server being installed and one for querying the remote master (currently we have a nasty hack that switches the ldap2 backend URI to do this).

Fixing this should also make it easier to do dependency injection for testing.


master:

  • 2db741e ipalib: Allow multiple API instances
  • dae6a18 ipalib: Move plugin package setup to ipalib-specific API subclass
  • 2625efa advise: Add separate API object for ipa-advise
  • d7ef7e1 ldap2: Use self API instance instead of ipalib.api
  • 8713c5a replica-install: Use different API instance for the remote server

There are some test failures caused by this, reopening the ticket.

master:

  • f87ba5e plugable: Move plugin base class and override logic to API
  • fe2accf ipalib: Load ipaserver plugins when api.env.in_server is True
  • 7715d5b ipalib: Move find_modules_in_dir from util to plugable
  • 481f8dd plugable: Specify plugins to import in API by module names
  • 2d15153 plugable: Load plugins only from modules imported by API
  • e39fe4e plugable: Pass API to plugins on initialization rather than using set_api
  • 8600882 plugable: Do not use DictProxy for API
  • b1fc875 plugable: Lock API on finalization rather than on initialization
  • e9c9e3f ipaplatform: Do not use MagicDict for KnownServices
  • 1a21fd9 plugable: Remove SetProxy, DictProxy and MagicDict
  • 4b277d0 plugable: Change is_production_mode to method of API
  • 2b12bca plugable: Specify plugin base classes and modules using API properties
  • 5b39bc1 plugable: Remove unused call method of Plugin
  • e43296b replica prepare: Do not use entry after disconnecting from LDAP

Metadata Update from @pviktori:
- Issue assigned to jcholast
- Issue set to the milestone: FreeIPA 4.2

7 years ago

Login to comment on this ticket.

Metadata