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
49dce05c
Commit
49dce05c
authored
Oct 29, 2012
by
Seth Vidal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up remove and fix fixme checking to see if pkg was removed
parent
7c1e0de1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
library/yum
+31
-27
No files found.
library/yum
View file @
49dce05c
...
@@ -429,42 +429,46 @@ def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
...
@@ -429,42 +429,46 @@ def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
res
[
'msg'
]
=
''
res
[
'msg'
]
=
''
res
[
'changed'
]
=
False
res
[
'changed'
]
=
False
res
[
'rc'
]
=
0
res
[
'rc'
]
=
0
res
[
'failed'
]
=
False
for
spec
in
items
:
for
pkg
in
items
:
pkg
=
None
is_group
=
False
# group remove - this is doom on a stick
# group remove - hope you like things dying!
if
pkg
.
startswith
(
'@'
):
if
spec
.
startswith
(
'@'
):
is_group
=
True
pkg
=
spec
# req or pkgname remove
else
:
else
:
pkglist
=
is_installed
(
module
,
repoq
,
spec
,
conf_file
,
en_repos
=
en_repos
,
dis_repos
=
dis_repos
)
if
not
is_installed
(
module
,
repoq
,
pkg
,
conf_file
,
en_repos
=
en_repos
,
dis_repos
=
dis_repos
):
if
not
pkglist
:
res
[
'results'
]
.
append
(
'
%
s is not installed'
%
pkg
)
found
=
False
else
:
found
=
True
if
not
found
:
res
[
'results'
]
.
append
(
'
%
s is not installed'
%
spec
)
continue
continue
pkg
=
spec
# run an actual yum transaction
cmd
=
yum_basecmd
+
[
"remove"
,
pkg
]
cmd
=
yum_basecmd
+
[
"remove"
,
pkg
]
rc
,
out
,
err
=
run
(
cmd
)
rc
,
out
,
err
=
run
(
cmd
)
# FIXME if we ran the remove - check to make sure it actually removed :(
# at this point we should check to see if the pkg is no longer present
# look for the pkg in the rpmdb - this is notoriously hard for groups :(
if
not
is_group
:
# we can't sensibly check for a group being uninstalled reliably
# look to see if the pkg shows up from is_installed. If it doesn't
if
not
is_installed
(
module
,
repoq
,
pkg
,
conf_file
,
en_repos
=
en_repos
,
dis_repos
=
dis_repos
):
res
[
'changed'
]
=
True
else
:
res
[
'failed'
]
=
True
if
rc
!=
0
:
if
rc
!=
0
:
res
[
'changed'
]
=
False
res
[
'failed'
]
=
True
res
[
'failed'
]
=
True
res
[
'rc'
]
=
rc
res
[
'results'
]
.
append
(
out
)
# compile the results into one batch. If anything is changed
res
[
'msg'
]
+=
err
# then mark changed
else
:
# at the end - if we've end up failed then fail out of the rest
res
[
'changed'
]
=
True
# of the process
res
[
'rc'
]
=
0
res
[
'changed'
]
=
res
[
'changed'
]
or
False
res
[
'results'
]
.
append
(
out
)
res
[
'failed'
]
=
res
[
'failed'
]
or
False
res
[
'msg'
]
+=
err
res
[
'rc'
]
+=
rc
res
[
'results'
]
.
append
(
out
)
res
[
'msg'
]
+=
err
if
res
[
'failed'
]:
module
.
fail_json
(
**
res
)
module
.
exit_json
(
**
res
)
module
.
exit_json
(
**
res
)
...
...
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