saltstack / saltstack/salt

[BUG] kwargs not available when using cmd.run via salt.cmd runner

Open
#60,959 3 comments 0 reactions 1 assignee View on GitHub

@frogunder is already working on this.

Since Sep 27, 2021.

bug pending-discussion
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
When passing kwarg values using salt-run salt.cmd cmd.run, those values are not usable from cmd.run. However, when using cmd.run via salt or salt-call, the values are available from within the cmd.run context.

Steps to Reproduce the behavior
run from the cli on the master

[root@salt-master /]# salt-run salt.cmd cmd.run 'echo $item' env='{"item": "value"}'
$item

Expected behavior
The expected behavior is for output like the following.

[root@salt-master /]# salt -C 'salt-master*' cmd.run 'echo $item' env='{"item": "value"}'
salt-master.alias454.local:
    value

[root@salt-master /]# salt-call cmd.run 'echo $item' env='{"item": "value"}'
local:
    value

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3003.3
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.1.4
 
System Versions:
          dist: centos 7 Core
        locale: UTF-8
       machine: x86_64
       release: 3.10.0-1160.42.2.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.