diff options
author | David Mulder <dmulder@samba.org> | 2023-03-14 12:37:54 -0600 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-04-28 02:15:36 +0000 |
commit | ac4726106c6d99794f03591fc0b526d91b947fad (patch) | |
tree | 13a61db2b519d9ef51bfb869fa6afd8ce9b7f151 | |
parent | a8bad5d5b859a2a76ce18919fbe2bf42f8ef7562 (diff) | |
download | samba-ac4726106c6d99794f03591fc0b526d91b947fad.tar.gz |
gpupdate: Deprecate libgpo.get_gpo_list
This is no longer used by gpupdate.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15225
Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | libgpo/pygpo.c | 5 | ||||
-rw-r--r-- | python/samba/gp/__init__.py | 17 | ||||
-rw-r--r-- | python/samba/tests/gpo.py | 6 | ||||
-rw-r--r-- | python/samba/tests/gpo_member.py | 2 |
4 files changed, 23 insertions, 7 deletions
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index 138097084a9..bf63a60522f 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -577,6 +577,11 @@ static PyObject *py_ads_get_gpo_list(ADS *self, PyObject *args, PyObject *kwds) size_t i; static const char *kwlist[] = {"samaccountname", NULL}; + + PyErr_WarnEx(PyExc_DeprecationWarning, "The get_gpo_list function" + " is deprecated as of Samba 4.19. Please use " + "the samba.gp module instead.", 2); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", discard_const_p(char *, kwlist), &samaccountname)) { diff --git a/python/samba/gp/__init__.py b/python/samba/gp/__init__.py new file mode 100644 index 00000000000..af6e63960dc --- /dev/null +++ b/python/samba/gp/__init__.py @@ -0,0 +1,17 @@ +# Unix SMB/CIFS implementation. +# Copyright (C) David Mulder <dmulder@samba.org> 2023 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from samba.gp.gpclass import get_gpo_list diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index 580bf7450cb..b912d53c83c 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -5062,12 +5062,6 @@ class GPOTests(tests.TestCase): self.assertEqual(gpos[i].ds_path, ds_paths[i], 'ds_path did not match expected %s' % gpos[i].ds_path) - def test_gpo_ads_does_not_segfault(self): - try: - ads = gpo.ADS_STRUCT(self.server, 42, self.creds) - except: - pass - def test_gpt_version(self): global gpt_data local_path = self.lp.cache_path('gpo_cache') diff --git a/python/samba/tests/gpo_member.py b/python/samba/tests/gpo_member.py index 642eb13a639..0fc09e81b03 100644 --- a/python/samba/tests/gpo_member.py +++ b/python/samba/tests/gpo_member.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba import gpo, tests +from samba import tests from samba.gp.gpclass import GPOStorage from samba.param import LoadParm from samba.credentials import Credentials |