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
65bf14cb
Commit
65bf14cb
authored
Sep 20, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12431 from hslee16/devel
Stops using _groups_list to check for host when using 'add_host'
parents
b11a44e5
cf289191
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lib/ansible/inventory/__init__.py
+3
-0
lib/ansible/plugins/strategy/__init__.py
+4
-4
No files found.
lib/ansible/inventory/__init__.py
View file @
65bf14cb
...
...
@@ -461,7 +461,10 @@ class Inventory(object):
return
matching_host
def
get_group
(
self
,
groupname
):
if
groupname
in
self
.
groups
:
return
self
.
groups
[
groupname
]
else
:
return
None
def
get_group_variables
(
self
,
groupname
,
update_cached
=
False
,
vault_password
=
None
):
if
groupname
not
in
self
.
_vars_per_group
or
update_cached
:
...
...
lib/ansible/plugins/strategy/__init__.py
View file @
65bf14cb
...
...
@@ -356,10 +356,10 @@ class StrategyBase:
new_group
.
add_host
(
new_host
)
# add this host to the group cache
if
self
.
_inventory
.
_groups_list
is
not
None
:
if
group_name
in
self
.
_inventory
.
_groups_list
:
if
new_host
.
name
not
in
self
.
_inventory
.
_groups_list
[
group_name
]
:
self
.
_inventory
.
_groups_list
[
group_name
]
.
append
(
new_host
.
name
)
if
self
.
_inventory
.
groups
is
not
None
:
if
group_name
in
self
.
_inventory
.
groups
:
if
new_host
not
in
self
.
_inventory
.
get_group
(
group_name
)
.
hosts
:
self
.
_inventory
.
get_group
(
group_name
)
.
hosts
.
append
(
new_host
.
name
)
# clear pattern caching completely since it's unpredictable what
# patterns may have referenced the group
...
...
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