Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
a3ab793b
Commit
a3ab793b
authored
13 years ago
by
Seth Vidal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for yum module for rhel5 and issue 269
parent
c701e595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
library/yum
+16
-2
No files found.
library/yum
View file @
a3ab793b
...
...
@@ -57,13 +57,24 @@ def pkg_to_dict(po):
'epoch'
:
po
.
epoch
,
'release'
:
po
.
release
,
'version'
:
po
.
version
,
'repo'
:
po
.
ui_from_repo
,
'_nevra'
:
po
.
ui_nevra
,
}
if
type
(
po
)
==
yum
.
rpmsack
.
RPMInstalledPackage
:
d
[
'yumstate'
]
=
'installed'
d
[
'repo'
]
=
'installed'
else
:
d
[
'yumstate'
]
=
'available'
d
[
'repo'
]
=
po
.
repoid
if
hasattr
(
po
,
'ui_from_repo'
):
d
[
'repo'
]
=
po
.
ui_from_repo
if
hasattr
(
po
,
'ui_nevra'
):
d
[
'_nevra'
]
=
po
.
ui_nevra
else
:
d
[
'_nevra'
]
=
'
%
s-
%
s-
%
s.
%
s'
%
(
po
.
name
,
po
.
version
,
po
.
release
,
po
.
arch
)
return
d
...
...
@@ -215,6 +226,9 @@ def ensure(my, state, pkgspec):
if
state
==
'latest'
:
updates
=
my
.
doPackageLists
(
pkgnarrow
=
'updates'
,
patterns
=
[
pkgspec
])
.
updates
# sucks but this is for rhel5 - won't matter for rhel6 or fedora or whatnot
e
,
m
,
u
=
yum
.
parsePackages
(
updates
,
[
pkgspec
],
casematch
=
True
)
updates
=
e
+
m
avail
=
my
.
doPackageLists
(
pkgnarrow
=
'available'
,
patterns
=
[
pkgspec
])
.
available
if
not
updates
and
not
avail
:
if
not
my
.
doPackageLists
(
pkgnarrow
=
'installed'
,
patterns
=
[
pkgspec
])
.
installed
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment