#1864 hub: deprecate debugFunction API
Closed 4 years ago by tkopecek. Opened 4 years ago by julian8628.
julian8628/koji issue/1833-depr  into  master

file modified
+1
@@ -11463,6 +11463,7 @@ 

          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:

file modified
+6 -1
@@ -94,6 +94,10 @@ 

      """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 @@ 

  

      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 = {}

It doesn't make much sense to have a deprecated warning in hub log for deprecated API
So having a tricky way to have this warning when calling it by ClientSession

fixes: #1833

pretty please pagure-ci rebuild

4 years ago

Pull-Request has been closed by tkopecek

4 years ago