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
30ad859f
Commit
30ad859f
authored
Apr 07, 2014
by
Andreas Fleig
Committed by
James Cammarata
Jul 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ini_file: replace lambda with named function
Fixes #6876
parent
0da5996b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
library/files/ini_file
+14
-0
No files found.
library/files/ini_file
View file @
30ad859f
...
...
@@ -95,6 +95,7 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
changed
=
False
cp
=
ConfigParser
.
ConfigParser
()
cp
.
optionxform
=
identity
try
:
f
=
open
(
filename
)
...
...
@@ -151,6 +152,19 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
return
changed
# ==============================================================
# identity
def
identity
(
arg
):
"""
This function simply returns its argument. It serves as a
replacement for ConfigParser.optionxform, which by default
changes arguments to lower case. The identity function is a
better choice than str() or unicode(), because it is
encoding-agnostic.
"""
return
arg
# ==============================================================
# main
def
main
():
...
...
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