Author: Vignesh R <vignesh.r@timesys.com>
Date: Tue, 25 Aug 2020 10:24:35 +0530

---
 libgpo/pygpo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c
index 97bbb3e..a4ba752 100644
--- a/libgpo/pygpo.c
+++ b/libgpo/pygpo.c
@@ -216,6 +216,7 @@ static int py_ads_init(ADS *self, PyObject *args, PyObject *kwds)
 }
 
 /* connect.  Failure to connect results in an Exception */
+#ifdef HAVE_LDAP
 static PyObject* py_ads_connect(ADS *self,
 		PyObject *Py_UNUSED(ignored))
 {
@@ -285,6 +286,7 @@ err:
 	TALLOC_FREE(frame);
 	return NULL;
 }
+#endif
 
 /* Parameter mapping and functions for the GP_EXT struct */
 void initgpo(void);
@@ -486,8 +488,10 @@ out:
 #endif
 
 static PyMethodDef ADS_methods[] = {
+#ifdef HAVE_LDAP
 	{ "connect", (PyCFunction)py_ads_connect, METH_NOARGS,
 		"Connect to the LDAP server" },
+#endif
 #ifdef HAVE_ADS
 	{ "get_gpo_list", PY_DISCARD_FUNC_SIG(PyCFunction, py_ads_get_gpo_list),
 		METH_VARARGS | METH_KEYWORDS,
-- 
2.7.4

