From 5872221bd49dda962391ddfb88f22e86bf72afec Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sun, 21 Sep 2008 21:30:19 +0000 Subject: 306: Added Plugin.set_api() method; added corresponding unit tests --- ipalib/plugable.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 9db4a5c6..19eae504 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -352,6 +352,14 @@ class Plugin(ReadOnly): assert api is not None, 'finalize() argument cannot be None' self.__api = api + def set_api(self, api): + """ + Set reference to `API` instance. + """ + assert self.__api is None, 'set_api() can only be called once' + assert api is not None, 'set_api() argument cannot be None' + self.__api = api + def __repr__(self): """ Returns a fully qualified module_name.class_name() representation that -- cgit