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
364313c0
Commit
364313c0
authored
9 years ago
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and speed up _split_role_params() by moving an invariant outside of a loop.
parent
1ae28f60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
lib/ansible/playbook/role/definition.py
+2
-1
No files found.
lib/ansible/playbook/role/definition.py
View file @
364313c0
...
@@ -178,10 +178,11 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
...
@@ -178,10 +178,11 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
role_def
=
dict
()
role_def
=
dict
()
role_params
=
dict
()
role_params
=
dict
()
base_attribute_names
=
frozenset
(
self
.
_get_base_attributes
()
.
keys
())
for
(
key
,
value
)
in
iteritems
(
ds
):
for
(
key
,
value
)
in
iteritems
(
ds
):
# use the list of FieldAttribute values to determine what is and is not
# use the list of FieldAttribute values to determine what is and is not
# an extra parameter for this role (or sub-class of this role)
# an extra parameter for this role (or sub-class of this role)
if
key
not
in
[
attr_name
for
(
attr_name
,
attr_value
)
in
iteritems
(
self
.
_get_base_attributes
())]
:
if
key
not
in
base_attribute_names
:
# this key does not match a field attribute, so it must be a role param
# this key does not match a field attribute, so it must be a role param
role_params
[
key
]
=
value
role_params
[
key
]
=
value
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
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