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
b44bc608
Commit
b44bc608
authored
Sep 16, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12400 from mcsalgado/dict_default_argument
Fix mutable default argument
parents
33e79203
54f1560d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
lib/ansible/inventory/dir.py
+4
-1
lib/ansible/inventory/ini.py
+4
-1
lib/ansible/inventory/script.py
+3
-1
No files found.
lib/ansible/inventory/dir.py
View file @
b44bc608
...
...
@@ -81,7 +81,10 @@ def get_file_parser(hostsfile, groups, loader):
class
InventoryDirectory
(
object
):
''' Host inventory parser for ansible using a directory of inventories. '''
def
__init__
(
self
,
loader
,
groups
=
dict
(),
filename
=
C
.
DEFAULT_HOST_LIST
):
def
__init__
(
self
,
loader
,
groups
=
None
,
filename
=
C
.
DEFAULT_HOST_LIST
):
if
groups
is
None
:
groups
=
dict
()
self
.
names
=
os
.
listdir
(
filename
)
self
.
names
.
sort
()
self
.
directory
=
filename
...
...
lib/ansible/inventory/ini.py
View file @
b44bc608
...
...
@@ -38,7 +38,10 @@ class InventoryParser(object):
with their associated hosts and variable settings.
"""
def
__init__
(
self
,
loader
,
groups
=
dict
(),
filename
=
C
.
DEFAULT_HOST_LIST
):
def
__init__
(
self
,
loader
,
groups
=
None
,
filename
=
C
.
DEFAULT_HOST_LIST
):
if
groups
is
None
:
groups
=
dict
()
self
.
_loader
=
loader
self
.
filename
=
filename
...
...
lib/ansible/inventory/script.py
View file @
b44bc608
...
...
@@ -36,7 +36,9 @@ from ansible.module_utils.basic import json_dict_bytes_to_unicode
class
InventoryScript
:
''' Host inventory parser for ansible using external inventory scripts. '''
def
__init__
(
self
,
loader
,
groups
=
dict
(),
filename
=
C
.
DEFAULT_HOST_LIST
):
def
__init__
(
self
,
loader
,
groups
=
None
,
filename
=
C
.
DEFAULT_HOST_LIST
):
if
groups
is
None
:
groups
=
dict
()
self
.
_loader
=
loader
self
.
groups
=
groups
...
...
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