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

[BUG] zypperpkg.upgrade does not support name or pkgs parameters #62030

Closed
agraul opened this issue May 6, 2022 · 1 comment · Fixed by #62033
Closed

[BUG] zypperpkg.upgrade does not support name or pkgs parameters #62030

agraul opened this issue May 6, 2022 · 1 comment · Fixed by #62033
Assignees
Labels
Bug broken, incorrect, or confusing behavior needs-triage SLES

Comments

@agraul
Copy link
Contributor

agraul commented May 6, 2022

Description

pkg.upgrade name=foo works with yumpkg, but not with zypperpkg. Different pkg implementations should try to support the same arguments where it makes sense. Passing name or pkgs to limit the number of packages that will be upgraded makes sense to a Salt user.

Setup

One minion with yum, e.g. AlmaLinux 8 and another with zypper (e.g. openSUSE Leap 15.3). Salt 3004 on the master and the minions.

Steps to Reproduce the behavior:
salt '*' pkg.upgrade name=foo and salt '*' pkg.upgrade pkgs='["foo", "bar"]':
In both cases, the minion running zypper ignores the parameter that restricts the packages to be upgraded and upgrades all packages.

Expected behavior:

zypper only update the packages that are specified, the same way that yum does it. If dependencies need to be updated along with the specified packages, they will also be updated. All updated packages are reported in the job return dict and rendered on the CLI.

Versions Report

salt --versions-report The exact version does not matter, `zypperpkg.upgrade` does not know the parameter in any of them. I reproduced this on a setup using
Salt Version:
          Salt: 3002.2
 
Dependency Versions:
          cffi: 1.13.2
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: 0.28.4
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.17
      pycrypto: 3.9.0
  pycryptodome: Not Installed
        pygit2: 0.28.2
        Python: 3.6.13 (default, Mar 10 2021, 18:30:35) [GCC]
  python-gnupg: Not Installed
        PyYAML: 5.4.1
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.2.3
 
System Versions:
          dist: sles 15.3 2021.05
        locale: UTF-8
       machine: x86_64
       release: 5.3.18-59.27-default
        system: Linux
       version: SLES 15.3 2021.05

Additional context
Add any other context about the problem here.

@agraul agraul added Bug broken, incorrect, or confusing behavior needs-triage labels May 6, 2022
@agraul agraul self-assigned this May 6, 2022
@damon-atkins
Copy link
Contributor

@agraul you can call a the pkg state instead from the command line. However agree their should be consistence, where possible.

@OrangeDog OrangeDog added the SLES label May 12, 2022
agraul added a commit to openSUSE/salt that referenced this issue Jun 14, 2022
Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)
meaksh pushed a commit to openSUSE/salt that referenced this issue Jul 7, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
agraul added a commit to agraul/salt that referenced this issue Oct 6, 2022
Ch3LL pushed a commit that referenced this issue Oct 6, 2022
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 28, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 28, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 29, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 29, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 29, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
meaksh pushed a commit to openSUSE/salt that referenced this issue Dec 29, 2022
…ade()/yumpkg.upgrade() - backport 3004 (#538)

* Migrate zypper.upgrade tests to pytest

(cherry picked from commit ecce005b543f66198c7ac118966254dd3d60682f)

* Add names and pkgs parameters to zypper.upgrade

Fixes saltstack/salt#62030

(cherry picked from commit 19ebb40dc4538c983721a8746a201b7f1300c2f7)

* Don't turn attr="all" into a list

pkg_resource.format_pkg_list expects its `attr` argument to be either a
list of attributes or the string "all" to indicate all available
attributes should be used for formatting.

Fixes: saltstack/salt#62032
(cherry picked from commit 05482da89b91442235d3cc2889e59ac3722a7fae)

* Add diff_attr parameter to zypper/yum upgrade

diff_attr works just like it does for pkg.install. Having the
option to return additional attributes can remove the need for a
follow-up list_pkgs call.

Fixes: saltstack/salt#62031
(cherry picked from commit 20ffffe3be6c7d94e9cc3338a57bbf5014f33d93)
blu-base pushed a commit to blu-base/saltext-zypper that referenced this issue Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage SLES
Projects
None yet
3 participants