summaryrefslogtreecommitdiffstats
path: root/ipaplatform/rhel
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2016-11-18 15:42:23 +0100
committerMartin Basti <mbasti@redhat.com>2016-11-24 16:30:32 +0100
commit6409abf1a60f3548203e6607a2b157ff72af2c89 (patch)
tree2d1c06b3fc85d91f9d4bea67162a1ab9dcdca07e /ipaplatform/rhel
parent2cbaf156045769b54150e4d4c3c1071f164a16fb (diff)
downloadfreeipa-6409abf1a60f3548203e6607a2b157ff72af2c89.tar.gz
freeipa-6409abf1a60f3548203e6607a2b157ff72af2c89.tar.xz
freeipa-6409abf1a60f3548203e6607a2b157ff72af2c89.zip
Break ipaplatform / ipalib import cycle of hell
Here is an attempt to break the import cycle of hell between ipaplatform and ipalib. All services now pass an ipalib.api object to services.service(). RedHatServices.__init__() still needs to do a local import because it initializes its wellknown service dict with service instances. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaplatform/rhel')
-rw-r--r--ipaplatform/rhel/services.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipaplatform/rhel/services.py b/ipaplatform/rhel/services.py
index 980c84a96..7918006db 100644
--- a/ipaplatform/rhel/services.py
+++ b/ipaplatform/rhel/services.py
@@ -41,17 +41,17 @@ class RHELService(redhat_services.RedHatService):
# Function that constructs proper RHEL-specific server classes for services
# of specified name
-def rhel_service_class_factory(name):
+def rhel_service_class_factory(name, api=None):
if name == 'domainname':
- return RHELService(name)
- return redhat_services.redhat_service_class_factory(name)
+ return RHELService(name, api)
+ return redhat_services.redhat_service_class_factory(name, api)
# Magicdict containing RHELService instances.
class RHELServices(redhat_services.RedHatServices):
- def service_class_factory(self, name):
- return rhel_service_class_factory(name)
+ def service_class_factory(self, name, api=None):
+ return rhel_service_class_factory(name, api)
# Objects below are expected to be exported by platform module