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
98a43311
Commit
98a43311
authored
May 24, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2999 from ngrilly/python
Python
parents
5fdca267
7aee5889
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/ansible/inventory/__init__.py
+7
-7
No files found.
lib/ansible/inventory/__init__.py
View file @
98a43311
...
...
@@ -62,18 +62,18 @@ class Inventory(object):
self
.
_also_restriction
=
None
self
.
_subset
=
None
if
type
(
host_list
)
in
[
str
,
unicode
]
:
if
host_list
.
find
(
","
)
!=
-
1
:
if
isinstance
(
host_list
,
basestring
)
:
if
","
in
host_list
:
host_list
=
host_list
.
split
(
","
)
host_list
=
[
h
for
h
in
host_list
if
h
and
h
.
strip
()
]
if
type
(
host_list
)
==
list
:
if
isinstance
(
host_list
,
list
)
:
self
.
parser
=
None
all
=
Group
(
'all'
)
self
.
groups
=
[
all
]
for
x
in
host_list
:
if
x
.
find
(
":"
)
!=
-
1
:
tokens
=
x
.
split
(
":"
,
1
)
if
":"
in
x
:
tokens
=
x
.
split
(
":"
,
1
)
all
.
add_host
(
Host
(
tokens
[
0
],
tokens
[
1
]))
else
:
all
.
add_host
(
Host
(
x
))
...
...
@@ -316,7 +316,7 @@ class Inventory(object):
to exclude failed hosts in main playbook code, don't use this for other
reasons.
"""
if
type
(
restriction
)
!=
list
:
if
not
isinstance
(
restriction
,
list
)
:
restriction
=
[
restriction
]
self
.
_restriction
=
restriction
...
...
@@ -325,7 +325,7 @@ class Inventory(object):
Works like restict_to but offers an additional restriction. Playbooks use this
to implement serial behavior.
"""
if
type
(
restriction
)
!=
list
:
if
not
isinstance
(
restriction
,
list
)
:
restriction
=
[
restriction
]
self
.
_also_restriction
=
restriction
...
...
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