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
18837517
Commit
18837517
authored
Mar 10, 2014
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inventory: raise error when adding a group that already exists.
The parsers check if a group already exists.
parent
be58808f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lib/ansible/inventory/__init__.py
+5
-3
No files found.
lib/ansible/inventory/__init__.py
View file @
18837517
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#############################################
#############################################
import
fnmatch
import
fnmatch
import
os
import
os
import
sys
import
sys
...
@@ -376,8 +375,11 @@ class Inventory(object):
...
@@ -376,8 +375,11 @@ class Inventory(object):
return
vars
return
vars
def
add_group
(
self
,
group
):
def
add_group
(
self
,
group
):
self
.
groups
.
append
(
group
)
if
group
.
name
not
in
self
.
groups_list
():
self
.
_groups_list
=
None
# invalidate internal cache
self
.
groups
.
append
(
group
)
self
.
_groups_list
=
None
# invalidate internal cache
else
:
raise
errors
.
AnsibleError
(
"group already in inventory:
%
s"
%
group
.
name
)
def
list_hosts
(
self
,
pattern
=
"all"
):
def
list_hosts
(
self
,
pattern
=
"all"
):
...
...
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