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
edea537c
Commit
edea537c
authored
Aug 05, 2014
by
Nico Cesar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if python >=2.7 use the option allow_no_value=True for ini_file.
parent
2d84a9d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
library/files/ini_file
+5
-1
No files found.
library/files/ini_file
View file @
edea537c
...
...
@@ -87,6 +87,7 @@ EXAMPLES = '''
'''
import
ConfigParser
import
sys
# ==============================================================
# do_ini
...
...
@@ -94,7 +95,10 @@ import ConfigParser
def
do_ini
(
module
,
filename
,
section
=
None
,
option
=
None
,
value
=
None
,
state
=
'present'
,
backup
=
False
):
changed
=
False
cp
=
ConfigParser
.
ConfigParser
()
if
(
sys
.
version_info
[
0
]
==
2
and
sys
.
version_info
[
1
]
>=
7
)
or
sys
.
version_info
[
0
]
>=
3
:
cp
=
ConfigParser
.
ConfigParser
(
allow_no_value
=
True
)
else
:
cp
=
ConfigParser
.
ConfigParser
()
cp
.
optionxform
=
identity
try
:
...
...
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