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

Runner state.orchestrate_show_sls is broken in 2018.3 #50556

Closed
ezh opened this issue Nov 18, 2018 · 8 comments

Comments

@ezh
Copy link
Contributor

commented Nov 18, 2018

Description of Issue/Question

runner state.orchestrate_show_sls is broken in 2018.3

Current behaviour

pepper --client runner state.orchestrate_show_sls mods=minion_start
runner:
    Exception occurred in runner state.orchestrate_show_sls: Traceback (most recent call last):
      File "/opt/saltstack/lib/python3.6/site-packages/salt/client/mixins.py", line 387, in _low
        data['return'] = self.functions[fun](*args, **kwargs)
      File "/opt/saltstack/lib/python3.6/site-packages/salt/runners/state.py", line 237, in orchestrate_show_sls
        pillar_enc=pillar_enc)
    TypeError: show_sls() takes from 1 to 3 positional arguments but 4 were given

Expected behaviour

pepper --client runner state.orchestrate_show_sls mods=orch.minion_start saltenv=feature/ec2_grains 'pillar={"tgt":1}'
runner:
    ----------
    us-west-1-test-aaksenov2-mesos-saltmaster-tf-local_master:
        ----------
        minion_refresh_pillar_{target}:
            ----------
            __env__:
                feature/ec2_grains

Setup

nothing special

Steps to Reproduce Issue

invoke state.orchestrate_show_sls with any parameters

like

pepper --client runner state.orchestrate_show_sls mods=minion_start

Versions Report

Salt Version:
           Salt: 2018.3.0-n/a-4d9e2a0

Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: 2.7.3
      docker-py: 3.5.1
          gitdb: 2.0.5
      gitpython: 2.1.11
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.6 |Anaconda, Inc.| (default, Oct  9 2018, 12:34:16)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.1.2
           RAET: Not Installed
          smmap: 2.0.5
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5
@ezh

This comment has been minimized.

Copy link
Contributor Author

commented Nov 18, 2018

Sorry. It is fixed in develop branch.

@ezh ezh closed this Nov 18, 2018
@ezh ezh reopened this Nov 18, 2018
@ezh

This comment has been minimized.

Copy link
Contributor Author

commented Nov 18, 2018

PR will be available shortly

@grichmond-salt

This comment has been minimized.

Copy link

commented Jan 31, 2019

Using this very simple state:

my_test:
  test.configurable_test_state:
    - name: Test
    - changes: False
    - result: True
    - comment: 'This is a test'

the command salt-run state.orchestrate_show_sls orch.test shows:

Exception occurred in runner state.orchestrate_show_sls: Traceback (most recent call last):
  File "/opt/saltstack/lib/python2.7/site-packages/salt/client/mixins.py", line 387, in _low
    data['return'] = self.functions[fun](*args, **kwargs)
  File "/opt/saltstack/lib/python2.7/site-packages/salt/runners/state.py", line 236, in orchestrate_show_sls
    pillar_enc=pillar_enc)
TypeError: show_sls() takes at most 3 arguments (7 given)

Version: 2018.3.3

@ezh

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

The patch is very simple.

diff --git a/salt/runners/state.py b/salt/runners/state.py
index 430cb518f5..9a4fffee1f 100644
--- a/salt/runners/state.py
+++ b/salt/runners/state.py
@@ -203,7 +203,7 @@ def orchestrate_high(data, test=None, queue=False, pillar=None, **kwargs):
 def orchestrate_show_sls(mods,
                          saltenv='base',
                          test=None,
-                         exclude=None,
+                         queue=False,
                          pillar=None,
                          pillarenv=None,
                          pillar_enc=None):
@@ -228,12 +228,12 @@ def orchestrate_show_sls(mods,
     minion = salt.minion.MasterMinion(__opts__)
     running = minion.functions['state.show_sls'](
         mods,
-        saltenv,
         test,
-        exclude,
+        queue,
         pillar=pillar,
         pillarenv=pillarenv,
-        pillar_enc=pillar_enc)
+        pillar_enc=pillar_enc,
+        saltenv=saltenv)

     ret = {minion.opts['id']: running}
     return ret
@ezh

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

I could create one more PR. The last try was unsuccessful. Which branch should I take?

@garethgreenaway

This comment has been minimized.

Copy link
Member

commented Jan 31, 2019

@ezh If you could base the PR off 2018.3 that would be great.

dwoz added a commit that referenced this issue Feb 13, 2019
fix #50556 state.orchestrate_show_sls
@dwoz dwoz closed this in a3ee70c Feb 23, 2019
NicolasT added a commit to scality/metalk8s that referenced this issue Apr 24, 2019
In Salt 2018.3 and 2019.2, the `state.orchestrate_show_sls` runner is
broken. There's a patch merged in the current development version,
however.

This PR adds the fixed version to the `metalk8s_saltutil` runner module
for now.

See: saltstack/salt#50556
See: saltstack/salt#51465
See: saltstack/salt#51951
@OrangeDog

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

This fix missed 2018.3.4, didn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.