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

Fixes some issues on the Zypper module #49722

Merged
merged 2 commits into from Sep 21, 2018

Conversation

Projects
None yet
4 participants
@meaksh
Copy link
Member

commented Sep 20, 2018

What does this PR do?

This PR fixes two issues on the Zypper module:

  • Fix an error happening in some cases when running resolve_capabilities on Python 3.
  • Fix a wrong queryformat for RPM which produces an exception when running pkg.list_provides on Zypper module.

Previous Behavior

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
    File "/usr/lib/python3.6/site-packages/salt/state.py", line 1878, in call
      **cdata['kwargs'])
    File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1823, in wrapper
      return f(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/salt/states/pkg.py", line 1487, in installed
      pkgs, refresh = _resolve_capabilities(pkgs, refresh=refresh, **kwargs)
    File "/usr/lib/python3.6/site-packages/salt/states/pkg.py", line 899, in _resolve_capabilities
      ret = __salt__['pkg.resolve_capabilities'](pkgs, refresh=refresh, **kwargs)
    File "/usr/lib/python3.6/site-packages/salt/modules/zypper.py", line 2255, in resolve_capabilities
      name = result.keys()[0]
TypeError: 'dict_keys' object does not support indexing

and also:

An exception occurred in this state: Traceback (most recent call last):
    File "/usr/lib/python3.6/site-packages/salt/state.py", line 1878, in call
      **cdata['kwargs'])
    File "/usr/lib/python3.6/site-packages/salt/loader.py", line 1823, in wrapper
      return f(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/salt/states/pkg.py", line 1511, in installed
      **kwargs)
    File "/usr/lib/python3.6/site-packages/salt/states/pkg.py", line 512, in _find_install_targets
      cur_prov = resolve_capabilities and __salt__['pkg.list_provides'](**kwargs) or dict()
    File "/usr/lib/python3.6/site-packages/salt/modules/zypper.py", line 2193, in list_provides
      provide, realname = line.split('_|-')
ValueError: not enough values to unpack (expected 2, got 1)

New Behavior

No exceptions are produced. It run successfully.

Tests written?

No

Commits signed with GPG?

Yes

meaksh added some commits Sep 20, 2018

@salt-jenkins salt-jenkins requested a review from saltstack/team-suse Sep 20, 2018

@isbm

isbm approved these changes Sep 21, 2018

@rallytime rallytime merged commit 6a3e127 into saltstack:2018.3 Sep 21, 2018

6 of 10 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has failed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has failed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has failed
Details
WIP ready for review
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details

@meaksh meaksh deleted the meaksh:2018.3-fix-zypper-issue-on-python3 branch Sep 21, 2018

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