Skip to content

[BUG] Missing SSH wrapper for logmod #65630

@lkubb

Description

@lkubb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbroken, incorrect, or confusing behaviorneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions