{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/30030","labels_url":"https://api.github.com/repos/saltstack/salt/issues/30030/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/30030/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/30030/events","html_url":"https://github.com/saltstack/salt/issues/30030","id":124096694,"number":30030,"title":"Cannot seem to set environment variables via kwarg for salt.function (Beryllium)","user":{"login":"windoverwater","id":949549,"avatar_url":"https://avatars.githubusercontent.com/u/949549?v=3","gravatar_id":"","url":"https://api.github.com/users/windoverwater","html_url":"https://github.com/windoverwater","followers_url":"https://api.github.com/users/windoverwater/followers","following_url":"https://api.github.com/users/windoverwater/following{/other_user}","gists_url":"https://api.github.com/users/windoverwater/gists{/gist_id}","starred_url":"https://api.github.com/users/windoverwater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windoverwater/subscriptions","organizations_url":"https://api.github.com/users/windoverwater/orgs","repos_url":"https://api.github.com/users/windoverwater/repos","events_url":"https://api.github.com/users/windoverwater/events{/privacy}","received_events_url":"https://api.github.com/users/windoverwater/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Fixed%20Pending%20Verification","name":"Fixed Pending Verification","color":"d4c5f9"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Medium%20Severity","name":"Medium Severity","color":"fad8c7"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2824,"closed_issues":3126,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-12-30T05:23:21Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-12-28T17:44:15Z","updated_at":"2015-12-30T15:35:53Z","closed_at":null,"body":"First time reporting a potential bug - trying to get it right - apologies in advance for any WTF's\r\n\r\nThe following state file can be used as a test case - it demonstrates that an environment variable is not being set via kwarg inside a salt-function when in theory it should be:\r\n\r\n    test-env:\r\n      salt.function:\r\n        - name: cmd.run\r\n        - tgt: githq-4.foobar.com\r\n        - kwarg:\r\n          - env:\r\n            force: 'yes'\r\n        - arg:\r\n          - bash -c 'echo force=$force SHELL=$SHELL test'\r\n\r\nRunning the above in Beryllium (master and minion) gives a:\r\n\r\n    $ sudo salt-run state.orch orch/test-env\r\n    dns2.foobar.com_master:\r\n    ----------\r\n              ID: test-env\r\n        Function: salt.function\r\n            Name: cmd.run\r\n          Result: True\r\n         Comment: Function ran successfully. Function cmd.run ran on githq-4.foobar.com.\r\n         Started: 12:29:00.906753\r\n        Duration: 307.69 ms\r\n         Changes:   \r\n                  githq-4.foobar.com:\r\n                      force= SHELL=/bin/bash test\r\n    \r\n    Summary for dns2.foobar.com_master\r\n    ------------\r\n    Succeeded: 1 (changed=1)\r\n    Failed:    0\r\n    ------------\r\n    Total states run:     1\r\n    Total run time: 307.690 ms\r\n\r\nAs far as I can tell the force should be 'yes'.  Yes?\r\n\r\nHere is the version info:\r\n\r\n# the minion\r\n$ sudo salt githq-4.foobar.com test.versions_report\r\ngithq-4.foobar.com:\r\n    Salt Version:\r\n               Salt: 2015.8.3\r\n     \r\n    Dependency Versions:\r\n             Jinja2: 2.7.2\r\n           M2Crypto: 0.21.1\r\n               Mako: 0.9.1\r\n             PyYAML: 3.10\r\n              PyZMQ: 14.0.1\r\n             Python: 2.7.6 (default, Jun 22 2015, 17:58:13)\r\n               RAET: Not Installed\r\n            Tornado: 4.2.1\r\n                ZMQ: 4.0.4\r\n               cffi: Not Installed\r\n           cherrypy: Not Installed\r\n           dateutil: 1.5\r\n              gitdb: Not Installed\r\n          gitpython: Not Installed\r\n              ioflo: Not Installed\r\n            libnacl: Not Installed\r\n       msgpack-pure: Not Installed\r\n     msgpack-python: 0.3.0\r\n       mysql-python: 1.2.3\r\n          pycparser: Not Installed\r\n           pycrypto: 2.6.1\r\n             pygit2: Not Installed\r\n       python-gnupg: Not Installed\r\n              smmap: Not Installed\r\n            timelib: Not Installed\r\n     \r\n    System Versions:\r\n               dist: Ubuntu 14.04 trusty\r\n            machine: x86_64\r\n            release: 3.13.0-40-generic\r\n             system: Ubuntu 14.04 trusty\r\n     \r\n# the master\r\n$ sudo salt dns2.foobar.com test.versions_report\r\ndns2.foobar.com:\r\n    Salt Version:\r\n               Salt: 2015.8.3\r\n     \r\n    Dependency Versions:\r\n             Jinja2: 2.7.2\r\n           M2Crypto: 0.21.1\r\n               Mako: Not Installed\r\n             PyYAML: 3.10\r\n              PyZMQ: 14.3.1\r\n             Python: 2.7.5 (default, Jun 17 2014, 18:11:42)\r\n               RAET: Not Installed\r\n            Tornado: 4.2.1\r\n                ZMQ: 3.2.5\r\n               cffi: Not Installed\r\n           cherrypy: Not Installed\r\n           dateutil: Not Installed\r\n              gitdb: Not Installed\r\n          gitpython: Not Installed\r\n              ioflo: Not Installed\r\n            libnacl: Not Installed\r\n       msgpack-pure: Not Installed\r\n     msgpack-python: 0.4.6\r\n       mysql-python: Not Installed\r\n          pycparser: Not Installed\r\n           pycrypto: 2.6.1\r\n             pygit2: Not Installed\r\n       python-gnupg: Not Installed\r\n              smmap: Not Installed\r\n            timelib: Not Installed\r\n     \r\n    System Versions:\r\n               dist: centos 7.1.1503 Core\r\n            machine: x86_64\r\n            release: 3.10.0-229.4.2.el7.x86_64\r\n             system: CentOS Linux 7.1.1503 Core\r\n     \r\n$ salt --version\r\nsalt 2015.8.3 (Beryllium)\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/168020375","html_url":"https://github.com/saltstack/salt/issues/30030#issuecomment-168020375","issue_url":"https://api.github.com/repos/saltstack/salt/issues/30030","id":168020375,"user":{"login":"windoverwater","id":949549,"avatar_url":"https://avatars.githubusercontent.com/u/949549?v=3","gravatar_id":"","url":"https://api.github.com/users/windoverwater","html_url":"https://github.com/windoverwater","followers_url":"https://api.github.com/users/windoverwater/followers","following_url":"https://api.github.com/users/windoverwater/following{/other_user}","gists_url":"https://api.github.com/users/windoverwater/gists{/gist_id}","starred_url":"https://api.github.com/users/windoverwater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windoverwater/subscriptions","organizations_url":"https://api.github.com/users/windoverwater/orgs","repos_url":"https://api.github.com/users/windoverwater/repos","events_url":"https://api.github.com/users/windoverwater/events{/privacy}","received_events_url":"https://api.github.com/users/windoverwater/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T15:35:53Z","updated_at":"2015-12-30T15:35:53Z","body":"Note - first time trying this but created a pull-request with a doc change.  Feel free to reject it - just wanted to try."}}