https://fedorahosted.org/freeipa/ticket/6082

patch attached


Traceback (most recent call last):
File "/usr/libexec/ipa/oddjob/com.redhat.idm.trust-fetch-domains", line 174, in <module> trust.add_new_domains_from_trust(api, None, trust_domain_object, domains) File "/usr/lib/python2.7/site-packages/ipaserver/plugins/trust.py", line 1684, in add_new_domains_from_trust
    trust_name, name, **dom)
File "/usr/lib/python2.7/site-packages/ipaserver/plugins/trust.py", line 435, in add_range
    ipanttrusteddomainsid=dom_sid)
File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 447, in __call__
    return self.__do_call(*args, **options)
File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 475, in __do_call
    ret = self.run(*args, **options)
File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 797, in run
    return self.execute(*args, **options)
File "/usr/lib/python2.7/site-packages/ipaserver/plugins/baseldap.py", line 1181, in execute
    *keys, **options)
File "/usr/lib/python2.7/site-packages/ipaserver/plugins/idrange.py", line 465, in pre_callback
    entry_attrs['ipanttrusteddomainsid'])
File "/usr/lib/python2.7/site-packages/ipaserver/plugins/idrange.py", line 338, in validate_trusted_domain_sid
    domain_validator = self.get_domain_validator()
File "/usr/lib/python2.7/site-packages/ipaserver/plugins/idrange.py", line 322, in get_domain_validator
    if not _dcerpc_bindings_installed:
NameError: global name '_dcerpc_bindings_installed' is not defined

From 0e0c860f8b555fb5fef7d13a7e3f9d3f361363c4 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Fri, 29 Jul 2016 16:46:09 +0200
Subject: [PATCH] idrange: fix unassigned global variable

Global variable '_dcerpc_bindings_installed' is in some cases used
before assigment. This patch ensures that _dcerpc_bindings_installed is
always initialized.

https://fedorahosted.org/freeipa/ticket/6082
---
 ipaserver/plugins/idrange.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ipaserver/plugins/idrange.py b/ipaserver/plugins/idrange.py
index ccd67995e5b42634387e1064e7c819b711f3ef99..3e9db0b6b734513547423901a8b3212b3cee9147 100644
--- a/ipaserver/plugins/idrange.py
+++ b/ipaserver/plugins/idrange.py
@@ -35,6 +35,9 @@ if api.env.in_server and api.env.context in ['lite', 'server']:
         _dcerpc_bindings_installed = True
     except ImportError:
         _dcerpc_bindings_installed = False
+else:
+    _dcerpc_bindings_installed = False
+
 
 ID_RANGE_VS_DNA_WARNING = """=======
 WARNING:
-- 
2.5.5

-- 
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