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] Missing SSH wrapper for logmod #65630

Closed
lkubb opened this issue Nov 28, 2023 · 1 comment · Fixed by #65517
Closed

[BUG] Missing SSH wrapper for logmod #65630

lkubb opened this issue Nov 28, 2023 · 1 comment · Fixed by #65517
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@lkubb
Copy link
Contributor

lkubb commented Nov 28, 2023

Description
The saltstack-formulas/template-formula by default makes heavy use of log.debug etc (and slsutil.merge, different issue). Trying to apply such a formula via Salt-SSH, one is tempted to reconsider one's life choices since each of the couple dozen log.debug calls for each .sls file that includes map.jinja results in a shimmed call via a new SSH connection.

Setup
irrelevant

Steps to Reproduce the behavior

$ salt-ssh my_minion log.debug "this should not result in a shimmed call" -l debug 2> repro_log
$ grep -A 1 'Performing shimmed, blocking command as follows' repro_log
[DEBUG   ] Performing shimmed, blocking command as follows:
log.debug this should not result in a shimmed call

Expected behavior
The log calls being processed/dropped locally

Screenshots

$ find /opt/saltstack/salt/lib/python3.10/site-packages/salt/client/ssh/wrapper/ -name logmod.py

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.4

Python Version:
        Python: 3.10.13 (main, Oct  4 2023, 21:54:22) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.12
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rocky 9.2 Blue Onyx
        locale: utf-8
       machine: x86_64
       release: 5.14.0-284.18.1.el9_2.x86_64
        system: Linux
       version: Rocky Linux 9.2 Blue Onyx

Additional context
Copying the logmod execution module into a wrapper reduces runtime from practically infinite to a couple of seconds.

Alternatives you have considered for comedic effect
Somehow warping spacetime to skip to the hopefully finite end of the run.
Adding a rule to Pylint in addition to the one about f-strings in log calls.

@lkubb lkubb added Bug broken, incorrect, or confusing behavior needs-triage labels Nov 28, 2023
@lkubb
Copy link
Contributor Author

lkubb commented Apr 20, 2024

This has been fixed already by the linked PR.

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.

1 participant