Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1091673 Details for
Bug 1156551
[rfe] use dnf instead of yum
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Potential backported solution
salt-2015.5.5-f22.1.diff (text/plain), 5.55 KB, created by
Rolf Fokkens
on 2015-11-09 09:50:23 UTC
(
hide
)
Description:
Potential backported solution
Filename:
MIME Type:
Creator:
Rolf Fokkens
Created:
2015-11-09 09:50:23 UTC
Size:
5.55 KB
patch
obsolete
>--- salt-2015.5.5/salt/modules/yumpkg.py.orig 2015-11-09 08:59:33.517241929 +0100 >+++ salt-2015.5.5/salt/modules/yumpkg.py 2015-11-09 09:43:27.650719117 +0100 >@@ -92,6 +92,17 @@ > return __virtualname__ > return False > >+def _yum(): >+ ''' >+ return yum or dnf depending on version >+ ''' >+ contextkey = 'yum_bin' >+ if contextkey not in __context__: >+ if 'fedora' in __grains__['os'].lower() and int(__grains__['osrelease']) >= 22: >+ __context__[contextkey] = 'dnf' >+ else: >+ __context__[contextkey] = 'yum' >+ return __context__[contextkey] > > def _parse_pkginfo(line): > ''' >@@ -140,7 +151,7 @@ > ''' > if not salt.utils.which('repoquery'): > __salt__['cmd.run']( >- ['yum', '-y', 'install', 'yum-utils'], >+ [_yum(), '-y', 'install', 'yum-utils'], > python_shell=False, > output_loglevel='trace' > ) >@@ -154,8 +165,14 @@ > Runs a repoquery command and returns a list of namedtuples > ''' > _check_repoquery() >+ >+ if _yum() == 'dnf': >+ _query_format = query_format.replace('-%{VERSION}_', '-%{EPOCH}:%{VERSION}_') >+ else: >+ _query_format = query_format >+ > cmd = 'repoquery --plugins --queryformat {0} {1}'.format( >- _cmd_quote(query_format), repoquery_args >+ _cmd_quote(_query_format), repoquery_args > ) > call = __salt__['cmd.run_all'](cmd, output_loglevel='trace') > if call['retcode'] != 0: >@@ -168,7 +185,12 @@ > '{0}'.format(comment) > ) > else: >- out = call['stdout'] >+ if _yum() == 'dnf': >+ # Remove the epoch when it is zero to maintain backward compatibility >+ remove_zero_epoch = call['stdout'].replace('-0:', '-') >+ out = remove_zero_epoch >+ else: >+ out = call['stdout'] > return out.splitlines() > > >@@ -1140,7 +1162,14 @@ > downgrade.append(pkgstr) > > if targets: >- cmd = 'yum -y {repo} {exclude} {branch} {gpgcheck} install {pkg}'.format( >+ if _yum() == 'dnf': >+ dnfopts = '--best --allowerasing' >+ else: >+ dnfopts = '' >+ >+ cmd = '{yum_command} -y {opts} {repo} {exclude} {branch} {gpgcheck} install {pkg}'.format( >+ yum_command=_yum(), >+ opts=dnfopts, > repo=repo_arg, > exclude=exclude_arg, > branch=branch_arg, >@@ -1150,7 +1179,8 @@ > __salt__['cmd.run'](cmd, output_loglevel='trace') > > if downgrade: >- cmd = 'yum -y {repo} {exclude} {branch} {gpgcheck} downgrade {pkg}'.format( >+ cmd = '{yum_command} -y {repo} {exclude} {branch} {gpgcheck} downgrade {pkg}'.format( >+ yum_command=_yum(), > repo=repo_arg, > exclude=exclude_arg, > branch=branch_arg, >@@ -1160,7 +1190,8 @@ > __salt__['cmd.run'](cmd, output_loglevel='trace') > > if to_reinstall: >- cmd = 'yum -y {repo} {exclude} {branch} {gpgcheck} reinstall {pkg}'.format( >+ cmd = '{yum_command} -y {repo} {exclude} {branch} {gpgcheck} reinstall {pkg}'.format( >+ yum_command=_yum(), > repo=repo_arg, > exclude=exclude_arg, > branch=branch_arg, >@@ -1230,7 +1261,8 @@ > refresh_db(branch_arg, repo_arg, exclude_arg) > > old = list_pkgs() >- cmd = 'yum -q -y {repo} {exclude} {branch} {gpgcheck} upgrade'.format( >+ cmd = '{yum_command} -q -y {repo} {exclude} {branch} {gpgcheck} upgrade'.format( >+ yum_command=_yum(), > repo=repo_arg, > exclude=exclude_arg, > branch=branch_arg, >@@ -1282,7 +1314,9 @@ > if not targets: > return {} > quoted_targets = [_cmd_quote(target) for target in targets] >- cmd = 'yum -q -y remove {0}'.format(' '.join(quoted_targets)) >+ cmd = '{yum_command} -q -y remove {0}'.format( >+ ' '.join(quoted_targets), >+ yum_command=_yum()) > __salt__['cmd.run'](cmd, output_loglevel='trace') > __context__.pop('pkg.list_pkgs', None) > new = list_pkgs() >@@ -1400,7 +1434,9 @@ > ret[target]['comment'] = ('Package {0} is set to be held.' > .format(target)) > else: >- cmd = 'yum -q versionlock {0}'.format(target) >+ cmd = '{yum_command} -q versionlock {0}'.format( >+ target, >+ yum_command=_yum()) > out = __salt__['cmd.run_all'](cmd) > > if out['retcode'] == 0: >@@ -1489,8 +1525,9 @@ > .format(target)) > else: > quoted_targets = [_cmd_quote(item) for item in search_locks] >- cmd = 'yum -q versionlock delete {0}'.format( >- ' '.join(quoted_targets) >+ cmd = '{yum_command} -q versionlock delete {0}'.format( >+ ' '.join(quoted_targets), >+ yum_command=_yum() > ) > out = __salt__['cmd.run_all'](cmd) > >@@ -1521,7 +1558,7 @@ > > salt '*' pkg.get_locked_packages > ''' >- cmd = 'yum -q versionlock list' >+ cmd = '{yum_command} -q versionlock list'.format(yum_command=_yum()) > ret = __salt__['cmd.run'](cmd).split('\n') > > if pattern: >@@ -1585,7 +1622,7 @@ > salt '*' pkg.group_list > ''' > ret = {'installed': [], 'available': [], 'available languages': {}} >- cmd = 'yum grouplist' >+ cmd = '{yum_command} grouplist'.format(yum_command=_yum()) > out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace').splitlines() > key = None > for idx in range(len(out)):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1156551
:
1038046
| 1091673 |
1128337