From 2061994f037fbc66cf6595e277d8d6db6aa631b9 Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Dec 06 2019 06:07:14 +0000 Subject: [PATCH 1/2] hub: deprecated docstr for debugFunction --- diff --git a/hub/kojihub.py b/hub/kojihub.py index a3507ba..1673aa3 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -11463,6 +11463,7 @@ class RootExports(object): repo_problem(repo_id) def debugFunction(self, name, *args, **kwargs): + """[DEPRECATED] This function is only for debug use""" # This is potentially dangerous, so it must be explicitly enabled allowed = context.opts.get('EnableFunctionDebug', False) if not allowed: From 7290e052588e9328a2f6df00d620d8b578cf480a Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Dec 06 2019 06:07:57 +0000 Subject: [PATCH 2/2] give ClientSession an ability to know deprecated calls --- diff --git a/koji/__init__.py b/koji/__init__.py index 6acd1bb..73fb677 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -94,6 +94,10 @@ def _(args): """Stub function for translation""" return args # pragma: no cover + +DEPRECATED_METHODS = ['debugFunction'] + + ## Constants ## RPM_HEADER_MAGIC = six.b('\x8e\xad\xe8') @@ -2627,7 +2631,8 @@ class ClientSession(object): def _callMethod(self, name, args, kwargs=None, retry=True): """Make a call to the hub with retries and other niceties""" - + if name in DEPRECATED_METHODS: + util.deprecated("'%s' has been deprecated" % name) if self.multicall: if kwargs is None: kwargs = {}