Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kulya
OpnSense
Commits
ecdd92a8
Commit
ecdd92a8
authored
Feb 01, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Feb 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(configd) improve error reporting
(cherry picked from commit
88ebf762
)
parent
47c77e97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
processhandler.py
src/opnsense/service/modules/processhandler.py
+4
-3
template.py
src/opnsense/service/modules/template.py
+11
-2
No files found.
src/opnsense/service/modules/processhandler.py
View file @
ecdd92a8
...
...
@@ -487,9 +487,10 @@ class Action(object):
return
ph_inline_actions
.
execute
(
self
,
inline_act_parameters
)
except
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
'[
%
s] Inline action failed at
%
s'
%
(
message_uuid
,
traceback
.
format_exc
()))
except
Exception
as
inline_exception
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
'[
%
s] Inline action failed with
%
s at
%
s'
%
(
message_uuid
,
inline_exception
,
traceback
.
format_exc
()))
return
'Execute error'
return
'Unknown action type'
src/opnsense/service/modules/template.py
View file @
ecdd92a8
...
...
@@ -232,7 +232,12 @@ class Template(object):
result_filenames
[
new_filename
][
key
]
=
target_filters
[
target_filter
][
key
]
template_filename
=
'
%
s/
%
s'
%
(
module_name
.
replace
(
'.'
,
'/'
),
src_template
)
j2_page
=
self
.
_j2_env
.
get_template
(
template_filename
)
# parse template, make sure issues can be traced back to their origin
try
:
j2_page
=
self
.
_j2_env
.
get_template
(
template_filename
)
except
jinja2
.
exceptions
.
TemplateSyntaxError
as
templExc
:
raise
Exception
(
"
%
s
%
s
%
s"
%
(
module_name
,
template_filename
,
templExc
))
for
filename
in
result_filenames
.
keys
():
if
not
(
filename
.
find
(
'['
)
!=
-
1
and
filename
.
find
(
']'
)
!=
-
1
):
# copy config data
...
...
@@ -245,7 +250,11 @@ class Template(object):
# make sure we're only rendering output once
if
filename
not
in
result
:
# render page and write to disc
content
=
j2_page
.
render
(
cnf_data
)
try
:
content
=
j2_page
.
render
(
cnf_data
)
except
Exception
as
render_exception
:
# push exception with context if anything fails
raise
Exception
(
"
%
s
%
s
%
s"
%
(
module_name
,
template_filename
,
render_exception
))
# prefix filename with defined root directory
filename
=
(
'
%
s/
%
s'
%
(
self
.
_target_root_directory
,
filename
))
.
replace
(
'//'
,
'/'
)
...
...
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