Last active
August 10, 2016 20:53
-
-
Save cchurch/0cd776cfc9a3e17f079c887987dabcd5 to your computer and use it in GitHub Desktop.
Quick fix for xmlsec initialize issue (copy into /etc/tower/conf.d/). Related to https://github.com/onelogin/python-saml/pull/149
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
xmlsec_init_lock = threading.Lock() | |
xmlsec_initialized = False | |
import dm.xmlsec.binding | |
original_xmlsec_initialize = dm.xmlsec.binding.initialize | |
def xmlsec_initialize(*args, **kwargs): | |
global xmlsec_init_lock, xmlsec_initialized, original_xmlsec_initialize | |
with xmlsec_init_lock: | |
if not xmlsec_initialized: | |
original_xmlsec_initialize(*args, **kwargs) | |
xmlsec_initialized = True | |
dm.xmlsec.binding.initialize = xmlsec_initialize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment