saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:

Home Page:https://repo.saltproject.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] salt.utils.versions.warn_until doesn't seem to be warn-ing

nicholasmhughes opened this issue · comments

Description
DeprecationWarning is being filtered somewhere...

Inserting a block like this into a function doesn't actually throw the warning (I tested by inserting it into test.ping):

    salt.utils.versions.warn_until(
        "Chlorine",
        "message here",
    )

but this block does throw the warning properly:

    salt.utils.versions.warn_until(
        "Chlorine",
        "message here",
        category=FutureWarning,
    )

The salt.utils.versions.warn_until function defaults to using the DeprecationWarning class. Changing the category argument to another class, such as Warning or FutureWarning, allows the warning to be shown as expected.

There are filters in place in a couple of places in the code, but I couldn't narrow down where it was being suppressed.

This is problematic, because users aren't being shown deprecation warnings as expected... so removal of functionality may come as a surprise.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005+0na.b18281e
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.3
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.14.1
        pygit2: Not Installed
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 23.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 10 buster
        locale: UTF-8
       machine: x86_64
       release: 4.19.0-20-amd64
        system: Linux
       version: Debian GNU/Linux 10 buster

@s0undt3ch any ideas here?

I can confirm this. Here is a simple reproducer: #59917 (comment)

Just ran a git bisect. Not sure why, but fe075aa is apparently where it started going sideways 😕

Hrm... that may be because I didn't have distro installed. Let's try that again...

24d503a looks like it