On 08/06/2013 10:46 AM, Tomas Babej wrote:
Hi,

a simple fix for an issue I found while reading the code.

--
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org



_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

One occurrence missing, thanks Alexander.

Tomas

--
--
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | Mobile: +421 949 134 729

From 46c9074f55a0f58fc92a17a849d6cc3344411cb9 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 6 Aug 2013 10:41:58 +0200
Subject: [PATCH] Remove overlapping use-cases of the same result variable

---
 ipaserver/dcerpc.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 4660842fc478508a9d693b4b2a539e8c77296f84..8bda4be4d061feb2f4d29f2f23d4508b03ee8f93 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -769,18 +769,18 @@ class TrustDomainInstance(object):
         ldap_uri = 'ldap://%s' % (result.pdc_dns_name)
         conn = _ldap.initialize(ldap_uri)
         conn.set_option(_ldap.OPT_SERVER_CONTROLS, [ExtendedDNControl()])
-        result = None
+        search_result = None
         try:
             (objtype, res) = conn.search_s('', _ldap.SCOPE_BASE)[0]
-            result = res['defaultNamingContext'][0]
+            search_result = res['defaultNamingContext'][0]
             self.info['dns_hostname'] = res['dnsHostName'][0]
         except _ldap.LDAPError, e:
             root_logger.error(
                 "LDAP error when connecting to %(host)s: %(error)s" %
                     dict(host=unicode(result.pdc_name), error=str(e)))
 
-        if result:
-           self.info['sid'] = self.parse_naming_context(result)
+        if search_result:
+           self.info['sid'] = self.parse_naming_context(search_result)
         return True
 
     def parse_naming_context(self, context):
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to