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
a37a8424
Commit
a37a8424
authored
Apr 16, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check resource_tags value before using it in ec2_vpc
Fixes #7024
parent
36b9bc4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
library/cloud/ec2_vpc
+2
-2
No files found.
library/cloud/ec2_vpc
View file @
a37a8424
...
@@ -237,7 +237,7 @@ def find_vpc(module, vpc_conn, vpc_id=None, cidr=None):
...
@@ -237,7 +237,7 @@ def find_vpc(module, vpc_conn, vpc_id=None, cidr=None):
vpc_tags
=
dict
((
t
.
name
,
t
.
value
)
for
t
in
vpc_conn
.
get_all_tags
(
filters
=
{
'resource-id'
:
vpc
.
id
}))
vpc_tags
=
dict
((
t
.
name
,
t
.
value
)
for
t
in
vpc_conn
.
get_all_tags
(
filters
=
{
'resource-id'
:
vpc
.
id
}))
# If the supplied list of ID Tags match a subset of the VPC Tags, we found our VPC
# If the supplied list of ID Tags match a subset of the VPC Tags, we found our VPC
if
set
(
resource_tags
.
items
())
.
issubset
(
set
(
vpc_tags
.
items
())):
if
resource_tags
and
set
(
resource_tags
.
items
())
.
issubset
(
set
(
vpc_tags
.
items
())):
found_vpcs
.
append
(
vpc
)
found_vpcs
.
append
(
vpc
)
found_vpc
=
None
found_vpc
=
None
...
@@ -309,7 +309,7 @@ def create_vpc(module, vpc_conn):
...
@@ -309,7 +309,7 @@ def create_vpc(module, vpc_conn):
vpc_spec_tags
=
module
.
params
.
get
(
'resource_tags'
)
vpc_spec_tags
=
module
.
params
.
get
(
'resource_tags'
)
vpc_tags
=
dict
((
t
.
name
,
t
.
value
)
for
t
in
vpc_conn
.
get_all_tags
(
filters
=
{
'resource-id'
:
vpc
.
id
}))
vpc_tags
=
dict
((
t
.
name
,
t
.
value
)
for
t
in
vpc_conn
.
get_all_tags
(
filters
=
{
'resource-id'
:
vpc
.
id
}))
if
not
set
(
vpc_spec_tags
.
items
())
.
issubset
(
set
(
vpc_tags
.
items
())):
if
vpc_spec_tags
and
not
set
(
vpc_spec_tags
.
items
())
.
issubset
(
set
(
vpc_tags
.
items
())):
new_tags
=
{}
new_tags
=
{}
for
(
key
,
value
)
in
set
(
vpc_spec_tags
.
items
()):
for
(
key
,
value
)
in
set
(
vpc_spec_tags
.
items
()):
...
...
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