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

Allow passing "kwargs" to "pkg.list_downloaded" on Zypper (bsc#1140193) #53693

Closed

Conversation

meaksh
Copy link
Contributor

@meaksh meaksh commented Jul 3, 2019

What does this PR do?

This PR fixes an issue with pkg.list_downloaded function in the Zypper module. This function currently does not accept any kwarg argument, which makes the logic of the pkg.downloaded state to crash.

Given the following example of SLS at /srv/salt/test_pkg.sls:

test_pkg_downloaded:
  pkg.downloaded:
    - name: salt

Running salt-call --local state.apply test_pkg will produce a traceback:

local:
----------
          ID: test_pkg_downloaded
    Function: pkg.downloaded
        Name: salt
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.7/site-packages/salt/state.py", line 1939, in call
                  ret = self.states[cdata['full']](*cdata['args'], **cdata['kwargs'])
                File "/usr/lib/python3.7/site-packages/salt/loader.py", line 1982, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3.7/site-packages/salt/states/pkg.py", line 2068, in downloaded
                  **kwargs)
                File "/usr/lib/python3.7/site-packages/salt/states/pkg.py", line 268, in _find_download_targets
                  cur_pkgs = __salt__['pkg.list_downloaded'](**kwargs)
              TypeError: list_downloaded() got an unexpected keyword argument 'fromrepo'
     Started: 09:20:36.896878
    Duration: 0.843 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   0.843 ms

Tests written?

Yes

Commits signed with GPG?

Yes

@cmcmarrow cmcmarrow requested review from cmcmarrow and removed request for cmcmarrow July 3, 2019 20:17
salt/modules/zypperpkg.py Show resolved Hide resolved
@meaksh
Copy link
Contributor Author

meaksh commented Apr 1, 2020

Closing in favor of #56490

@meaksh meaksh closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants