Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nicholasmhughes opened this issue Jun 17, 2022 · 6 comments · Fixed by #63315
Closed

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

nicholasmhughes opened this issue Jun 17, 2022 · 6 comments · Fixed by #63315
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@nicholasmhughes
Copy link
Collaborator

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
@nicholasmhughes nicholasmhughes added Bug broken, incorrect, or confusing behavior needs-triage labels Jun 17, 2022
@Ch3LL
Copy link
Contributor

Ch3LL commented Jul 14, 2022

@s0undt3ch any ideas here?

@max-arnold
Copy link
Contributor

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

@waynew
Copy link
Contributor

waynew commented Dec 13, 2022

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

@waynew
Copy link
Contributor

waynew commented Dec 13, 2022

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

@waynew
Copy link
Contributor

waynew commented Dec 13, 2022

24d503a looks like it

@waynew
Copy link
Contributor

waynew commented Dec 13, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants