Install via 'pip install lftools[ldap]'.
Change-Id: Ie2206b43b094e1576936ba934268dc0b68fc5a40
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
from lftools.cli.deploy import deploy
from lftools.cli.infofile import infofile
from lftools.cli.jenkins import jenkins_cli
-from lftools.cli.ldap_cli import ldap_cli
from lftools.cli.license import license
from lftools.cli.nexus import nexus
from lftools.cli.sign import sign
cli.add_command(nexus)
cli.add_command(sign)
cli.add_command(version)
-cli.add_command(ldap_cli, name='ldap')
+
+try:
+ from lftools.cli.ldap_cli import ldap_cli
+ cli.add_command(ldap_cli, name='ldap')
+except ImportError:
+ from lftools.cli.no_cmd import no_ldap as ldap_cli
+ cli.add_command(ldap_cli, name='ldap')
+
try:
from lftools.openstack.cmd import openstack
import sys
import click
+
import ldap
--- /dev/null
+# -*- code: utf-8 -*-
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+"""CLI configuration for ldap command."""
+
+__author__ = 'Thanh Ha'
+
+
+import click
+
+
+@click.group()
+@click.pass_context
+def no_ldap(ctx):
+ """(lftools[ldap]) Provides an ldap interface.
+
+ To activate this interface run `pip install lftools[ldap]`.
+ """
+ pass
--- /dev/null
+---
+fixes:
+ - |
+ The v0.16.0 pulled in a new ldap module which breaks if the ldap devel
+ libraries are not available on the system trying to use it. This hotfix
+ makes the ldap module optional.
click
-python-ldap
pyyaml
requests~=2.18.0
ruamel.yaml
Programming Language :: Python :: 3.7
[extras]
+ldap =
+ python-ldap~=3.1.0
openstack =
shade~=1.27.1