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
8a49dac5
Commit
8a49dac5
authored
Feb 18, 2013
by
lessmian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed remove_key
parent
093935ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
library/apt_key
+6
-5
No files found.
library/apt_key
View file @
8a49dac5
...
...
@@ -115,9 +115,9 @@ def add_key(module, key):
(
rc
,
out
,
err
)
=
module
.
run_command
(
cmd
,
data
=
key
,
check_rc
=
True
)
return
True
def
remove_key
(
key_id
):
def
remove_key
(
module
,
key_id
):
# FIXME: use module.run_command, fail at point of error and don't discard useful stdin/stdout
cmd
=
'apt-key del
%
s'
cmd
=
'apt-key del
%
s'
%
key_id
(
rc
,
out
,
err
)
=
module
.
run_command
(
cmd
,
check_rc
=
True
)
return
True
...
...
@@ -142,6 +142,7 @@ def main():
check_missing_binaries
(
module
)
keys
=
all_keys
(
module
)
return_values
=
{}
if
state
==
'present'
:
if
key_id
and
key_id
in
keys
:
...
...
@@ -164,13 +165,13 @@ def main():
if
not
key_id
:
module
.
fail_json
(
msg
=
"key is required"
)
if
key_id
in
keys
:
if
remove_key
(
key_id
):
if
remove_key
(
module
,
key_id
):
changed
=
True
else
:
# FIXME: module.fail_json or exit-json immediately at point of failure
module
.
fail_json
(
msg
=
"error removing key_id"
,
**
return_values
(
True
)
)
module
.
fail_json
(
msg
=
"error removing key_id"
,
**
return_values
)
module
.
exit_json
(
changed
=
changed
,
**
return_values
()
)
module
.
exit_json
(
changed
=
changed
,
**
return_values
)
# include magic from lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
...
...
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