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
cd57d599
Commit
cd57d599
authored
May 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If ansible is configured to use a log file but cannot write to it, exit, but don't traceback.
parent
496f06c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
lib/ansible/callbacks.py
+8
-1
lib/ansible/utils/template.py
+2
-2
No files found.
lib/ansible/callbacks.py
View file @
cd57d599
...
...
@@ -29,7 +29,14 @@ from ansible.color import stringc
import
logging
if
constants
.
DEFAULT_LOG_PATH
!=
''
:
logging
.
basicConfig
(
filename
=
constants
.
DEFAULT_LOG_PATH
,
level
=
logging
.
DEBUG
,
format
=
'
%(asctime)
s
%(name)
s
%(message)
s'
)
path
=
constants
.
DEFAULT_LOG_PATH
if
(
os
.
path
.
exists
(
path
)
and
not
os
.
access
(
path
,
os
.
W_OK
))
or
not
os
.
access
(
os
.
path
.
dirname
(
path
),
os
.
W_OK
):
sys
.
stderr
.
write
(
"log file at
%
s is not writeable, aborting
\n
"
%
path
)
sys
.
exit
(
1
)
logging
.
basicConfig
(
filename
=
path
,
level
=
logging
.
DEBUG
,
format
=
'
%(asctime)
s
%(name)
s
%(message)
s'
)
mypid
=
str
(
os
.
getpid
())
user
=
getpass
.
getuser
()
logger
=
logging
.
getLogger
(
"p=
%
s u=
%
s | "
%
(
mypid
,
user
))
...
...
lib/ansible/utils/template.py
View file @
cd57d599
...
...
@@ -247,14 +247,14 @@ def _legacy_varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
else
:
replacement
=
None
return
{
'replacement'
:
replacement
,
'start'
:
start
,
'end'
:
end
}
return
dict
(
replacement
=
replacement
,
start
=
start
,
end
=
end
)
if
is_complex
:
var_end
-=
1
if
text
[
var_end
]
!=
'}'
or
brace_level
!=
0
:
return
None
space
=
_legacy_varFindLimitSpace
(
basedir
,
vars
,
space
,
text
[
part_start
:
var_end
],
lookup_fatal
,
depth
,
expand_lists
)
return
{
'replacement'
:
space
,
'start'
:
start
,
'end'
:
end
}
return
dict
(
replacement
=
space
,
start
=
start
,
end
=
end
)
def
legacy_varReplace
(
basedir
,
raw
,
vars
,
lookup_fatal
=
True
,
depth
=
0
,
expand_lists
=
False
):
''' Perform variable replacement of $variables in string raw using vars dictionary '''
...
...
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