During review of Simo's patches I have found some inconsistencies between 'get_domain_level' function definition and its usage.

This little patch fixes them.

--
Martin^3 Babinsky
From 745231f2cf3b3bd4c1d113052c81387e84339de0 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Tue, 20 Oct 2015 10:22:36 +0200
Subject: [PATCH] fix dsinstance.py:get_domain_level function

This patch cleans up an unused parameter and fixes the return value when
'ipaDomainLevel' is found: instead of a dict we should return an integer.
---
 ipaserver/install/dsinstance.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 4c3203e447571e3beb1e7ca9b3e5dfecebb7333e..b1ad2d8902788b7bf8c5bfdbcd8a0c1b1f236998 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -165,7 +165,7 @@ def create_ds_user():
     )
 
 
-def get_domain_level(self, api=api):
+def get_domain_level(api=api):
     conn = ipaldap.IPAdmin(ldapi=True, realm=api.env.realm)
     conn.do_external_bind('root')
 
@@ -176,7 +176,7 @@ def get_domain_level(self, api=api):
         entry = conn.get_entry(dn, ['ipaDomainLevel'])
     except errors.NotFound:
         return 0
-    return {'result': int(entry.single_value['ipaDomainLevel'])}
+    return int(entry.single_value['ipaDomainLevel'])
 
 
 INF_TEMPLATE = """
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to