diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index 826b46e1095..794982721c4 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -15,6 +15,7 @@ class ConditionalDependencies( object ): self.config_file = config_file self.config = None self.job_runners = [] + self.authenticators = [] self.conditional_reqs = [] self.parse_configs() self.get_conditional_requirements() @@ -31,6 +32,18 @@ class ConditionalDependencies( object ): except (OSError, IOError): pass + # Parse auth conf + auth_conf_xml = self.config.get( + "auth_config_file", + join( dirname( self.config_file ), 'auth_conf.xml' ) ) + try: + for auth in ElementTree.parse( auth_conf_xml ).findall( 'authenticator' ): + auth_type = auth.find('type') + if auth_type is not None: + self.authenticators.append( auth_type.text ) + except (OSError, IOError): + pass + def get_conditional_requirements( self ): crfile = join( dirname( __file__ ), 'conditional-requirements.txt' ) for req in pkg_resources.parse_requirements( open( crfile ).readlines() ): @@ -76,6 +89,10 @@ class ConditionalDependencies( object ): # pygments is a dependency of weberror and only weberror return self.check_weberror() + def check_python_ldap( self ): + return ('ldap' in self.authenticators or + 'activedirectory' in self.authenticators) + def optional( config_file ): rval = [] diff --git a/lib/galaxy/dependencies/conditional-requirements.txt b/lib/galaxy/dependencies/conditional-requirements.txt index 4f7c8a9a9dc..c341d99023d 100644 --- a/lib/galaxy/dependencies/conditional-requirements.txt +++ b/lib/galaxy/dependencies/conditional-requirements.txt @@ -10,3 +10,4 @@ pbs_python drmaa statsd # PyRods not in PyPI +python-ldap==2.4.25