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
9cc4be26
Commit
9cc4be26
authored
Mar 12, 2014
by
James Laska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct test integration ec2 cleanup script
parent
e753b39e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test/integration/cleanup_ec2.py
+7
-5
No files found.
test/integration/cleanup_ec2.py
View file @
9cc4be26
...
...
@@ -15,12 +15,14 @@ def delete_aws_resources(get_func, attr, opts):
for
item
in
get_func
():
val
=
getattr
(
item
,
attr
)
if
re
.
search
(
opts
.
match_re
,
val
):
prompt_and_delete
(
"Delete object with
%
s=
%
s? [y/n]: "
%
(
attr
,
val
),
opts
.
assumeyes
)
prompt_and_delete
(
item
,
"Delete object with
%
s=
%
s? [y/n]: "
%
(
attr
,
val
),
opts
.
assumeyes
)
def
prompt_and_delete
(
prompt
,
assumeyes
):
while
not
assumeyes
:
assumeyes
=
raw_input
(
prompt
)
obj
.
delete
()
def
prompt_and_delete
(
item
,
prompt
,
assumeyes
):
if
not
assumeyes
:
assumeyes
=
raw_input
(
prompt
)
.
lower
()
==
'y'
assert
hasattr
(
item
,
'delete'
),
"Class <
%
s> has no delete attribute"
%
item
.
__class__
if
assumeyes
:
item
.
delete
()
def
parse_args
():
# Load details from credentials.yml
...
...
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