mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Move epoch removal
The previous commit causes a failure when a package does not have a version specified. Caught by integration tests, yay!
This commit is contained in:
parent
290192af56
commit
4fa7e4defe
1 changed files with 7 additions and 6 deletions
|
@ -1226,12 +1226,6 @@ def install(name=None,
|
|||
for pkg_item_list in pkg_params_items:
|
||||
if pkg_type == 'repository':
|
||||
pkgname, version_num = pkg_item_list
|
||||
if _yum() == 'yum':
|
||||
# yum install does not support epoch without the arch, and we
|
||||
# won't know what the arch will be when it's not provided. It
|
||||
# could either be the OS architecture, or 'noarch', and we
|
||||
# don't make that distinction in the pkg.list_pkgs return data.
|
||||
version_num = version_num.split(':', 1)[-1]
|
||||
else:
|
||||
try:
|
||||
pkgname, pkgpath, version_num = pkg_item_list
|
||||
|
@ -1254,6 +1248,13 @@ def install(name=None,
|
|||
# not None, since the only way version_num is not None is if RPM
|
||||
# metadata parsing was successful.
|
||||
if pkg_type == 'repository':
|
||||
if _yum() == 'yum':
|
||||
# yum install does not support epoch without the arch, and
|
||||
# we won't know what the arch will be when it's not
|
||||
# provided. It could either be the OS architecture, or
|
||||
# 'noarch', and we don't make that distinction in the
|
||||
# pkg.list_pkgs return data.
|
||||
version_num = version_num.split(':', 1)[-1]
|
||||
arch = ''
|
||||
try:
|
||||
namepart, archpart = pkgname.rsplit('.', 1)
|
||||
|
|
Loading…
Add table
Reference in a new issue