Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
csback
Commits
6aa17505
Commit
6aa17505
authored
Aug 02, 2019
by
thomas.forbriger
Committed by
Checksum Backup @bromo
Aug 02, 2019
Browse files
csbackntfy: print reasonable error message in case of missing keyword
parent
2f899dfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
csbackntfy.py
View file @
6aa17505
...
...
@@ -44,6 +44,8 @@
# 01/03/2013 V0.8 Improve error handling and use error codes
# 17/03/2013 V0.8.1 show number of critical and error entries in mail
# 01/09/2014 V0.9 (thof) use local mail transfer agent
# 02/08/2019 V0.10 (thof) print reasonable error meassage if non of the
# message level keywords is found
#
# =============================================================================
"""
...
...
@@ -65,7 +67,7 @@ import csbackErrorCodes as eCodes
from
email.mime.text
import
MIMEText
from
collections
import
deque
__version__
=
"V0.
9
"
__version__
=
"V0.
10
"
__subversion__
=
"$Id$"
__license__
=
"GPLv2+"
__author__
=
"Daniel Armbruster"
...
...
@@ -283,7 +285,10 @@ def main(argv=None):
elif
'INFO'
in
line
:
infoDeque
.
appendleft
(
"logfile: "
+
path
+
"
\n
"
+
line
)
else
:
logger
.
getLogger
().
info
(
"Illegal line in logfile found: '"
+
line
+
"'"
)
logger
.
getLogger
().
info
((
"Illegal line in logfile found
\n
"
+
" Line does not contain any of the csback message level keywords
\n
"
+
" %s %s %s %s
\n
The log line is:
\n
%s"
)
%
(
"CRITICAL"
,
"ERROR"
,
"WARNING"
,
"INFO"
,
line
))
except
IOError
as
err
:
raise
Error
(
"Error while reading logfiles: "
+
err
.
filename
,
\
eCodes
.
NTFY_IOError
)
...
...
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