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
5c95f681
Commit
5c95f681
authored
Mar 27, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #96 from skvidal/master
fix up yum module for rhel5.
parents
3f9f8de0
fc02992b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
library/yum
+16
-4
No files found.
library/yum
View file @
5c95f681
...
...
@@ -41,7 +41,12 @@ def yum_base(conf_file=None, cachedir=False):
if
conf_file
and
os
.
path
.
exists
(
conf_file
):
my
.
preconf
.
fn
=
conf_file
if
cachedir
:
if
hasattr
(
my
,
'setCacheDir'
):
my
.
setCacheDir
()
else
:
cachedir
=
yum
.
misc
.
getCacheDir
()
my
.
repos
.
setCacheDir
(
cachedir
)
my
.
conf
.
cache
=
0
return
my
...
...
@@ -209,14 +214,21 @@ def ensure(my, state, pkgspec):
return
res
if
state
==
'latest'
:
if
not
[
pkg_to_dict
(
po
)
for
po
in
my
.
doPackageLists
(
pkgnarrow
=
'updates'
,
patterns
=
[
pkgspec
])
.
updates
]:
# there nothing in updates matching this.
updates
=
my
.
doPackageLists
(
pkgnarrow
=
'updates'
,
patterns
=
[
pkgspec
])
.
updates
avail
=
my
.
doPackageLists
(
pkgnarrow
=
'available'
,
patterns
=
[
pkgspec
])
.
available
if
not
updates
and
not
avail
:
if
not
my
.
doPackageLists
(
pkgnarrow
=
'installed'
,
patterns
=
[
pkgspec
])
.
installed
:
msg
=
"No Package matching '
%
s' found available, installed or updated"
%
pkgspec
return
{
'changed'
:
False
,
'failed'
:
True
,
'msg'
:
msg
}
return
{
'changed'
:
False
,}
# we have something in updates
# we have something in updates or available
if
not
updates
:
cmd
=
"yum -c
%
s -d1 -y install '
%
s'"
%
(
yumconf
,
pkgspec
)
else
:
cmd
=
"yum -c
%
s -d1 -y update '
%
s'"
%
(
yumconf
,
pkgspec
)
rc
,
out
,
err
=
run_yum
(
cmd
)
# FIXME if it is - update it and check to see if it applied
# check to see if there is no longer an update available for the pkgspec
if
rc
:
...
...
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