Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
c50c9b38
Commit
c50c9b38
authored
6 years ago
by
David Schmitz
Browse files
Options
Downloads
Plain Diff
integrated changes from v1.5
parents
9f57f820
6974248c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flowspec/junos.py
+3
-5
3 additions, 5 deletions
flowspec/junos.py
flowspec/snmpstats.py
+10
-0
10 additions, 0 deletions
flowspec/snmpstats.py
flowspec/views.py
+2
-1
2 additions, 1 deletion
flowspec/views.py
with
15 additions
and
6 deletions
flowspec/junos.py
+
3
−
5
View file @
c50c9b38
...
@@ -229,11 +229,9 @@ def translate_frag_list(frag_list):
...
@@ -229,11 +229,9 @@ def translate_frag_list(frag_list):
def
get_frag
(
rule
):
def
get_frag
(
rule
):
result
=
''
result
=
''
if
rule
.
fragmenttype
:
if
rule
.
fragmenttype
:
tmp1
=
translate_frag_list
(
rule
.
fragmenttype
.
all
())
tmp
=
translate_frag_list
(
rule
.
fragmenttype
.
all
())
if
tmp1
!=
""
:
if
tmp
!=
""
:
result
=
'
,frag
'
+
tmp1
result
=
'
,frag
'
+
tmp
else
:
result
=
''
return
result
return
result
def
create_junos_name
(
rule
):
def
create_junos_name
(
rule
):
...
...
This diff is collapsed.
Click to expand it.
flowspec/snmpstats.py
+
10
−
0
View file @
c50c9b38
...
@@ -210,6 +210,16 @@ def helper_rule_ts_parse(ts_string):
...
@@ -210,6 +210,16 @@ def helper_rule_ts_parse(ts_string):
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
info
(
"
helper_rule_ts_parse(): ts_string=
"
+
str
(
ts_string
)
+
"
: got exception
"
+
str
(
e
))
logger
.
info
(
"
helper_rule_ts_parse(): ts_string=
"
+
str
(
ts_string
)
+
"
: got exception
"
+
str
(
e
))
ts
=
None
ts
=
None
if
ts
==
None
:
# other db may hav other time fmt:
logger
.
info
(
"
helper_rule_ts_parse(): trying with milli seconds fmt
"
)
try
:
ts
=
datetime
.
strptime
(
ts_string
,
'
%Y-%m-%d %H:%M:%S.%f+00:00
'
)
# TODO TZ offset assumed to be 00:00
except
Exception
as
e
:
logger
.
info
(
"
helper_rule_ts_parse(): ts_string=
"
+
str
(
ts_string
)
+
"
: got exception
"
+
str
(
e
))
ts
=
None
logger
.
info
(
"
helper_rule_ts_parse(): => ts=
"
+
str
(
ts
))
return
ts
return
ts
def
process_new_snmp_measurements__low_level
(
nowstr
,
samplecount
,
newdata
,
history
):
def
process_new_snmp_measurements__low_level
(
nowstr
,
samplecount
,
newdata
,
history
):
...
...
This diff is collapsed.
Click to expand it.
flowspec/views.py
+
2
−
1
View file @
c50c9b38
...
@@ -58,7 +58,8 @@ LOG_FILENAME = os.path.join(settings.LOG_FILE_LOCATION, 'gunicorn_views.log')
...
@@ -58,7 +58,8 @@ LOG_FILENAME = os.path.join(settings.LOG_FILE_LOCATION, 'gunicorn_views.log')
# FORMAT = '%(asctime)s %(levelname)s: %(message)s'
# FORMAT = '%(asctime)s %(levelname)s: %(message)s'
# logging.basicConfig(format=FORMAT)
# logging.basicConfig(format=FORMAT)
#formatter = logging.Formatter('%(asctime)s %(levelname)s %(clientip)s %(user)s: %(message)s') # leads to strange errors on test-lab
#formatter = logging.Formatter('%(asctime)s %(levelname)s %(clientip)s %(user)s: %(message)s') # leads to strange errors on test-lab
formatter
=
logging
.
Formatter
(
'
%(asctime)s %(levelname)s: %(message)s
'
)
#formatter = logging.Formatter('%(asctime)s %(levelname)s %(user)s: %(message)s')
formatter
=
logging
.
Formatter
(
'
%(asctime)s %(levelname)s: %(message)s
'
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
setLevel
(
logging
.
DEBUG
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment