Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.toolbox
Commits
a721147c
Commit
a721147c
authored
Mar 24, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promise/plugin: fix py2 support
parent
9ef77005
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
slapos/promise/plugin/check_cpu_temperature.py
slapos/promise/plugin/check_cpu_temperature.py
+1
-1
slapos/promise/plugin/check_network_errors_packets.py
slapos/promise/plugin/check_network_errors_packets.py
+2
-2
slapos/promise/plugin/check_network_transit.py
slapos/promise/plugin/check_network_transit.py
+1
-0
No files found.
slapos/promise/plugin/check_cpu_temperature.py
View file @
a721147c
# coding:utf-8
from
__future__
import
division
import
json
import
os
import
psutil
...
...
slapos/promise/plugin/check_network_errors_packets.py
View file @
a721147c
...
...
@@ -31,13 +31,13 @@ class RunPromise(GenericPromise):
# Check for network dropped packets
if
total_dropped
/
total_MB
>=
self
.
max_lost_packets
:
self
.
logger
.
error
(
"Network packets lost reached critical threshold: %s "
\
" (threshold is %s per MB)"
%
(
math
.
ceil
(
total_dropped
/
total_MB
),
self
.
max_lost_packets
))
" (threshold is %s per MB)"
%
(
int
(
math
.
ceil
(
total_dropped
/
total_MB
)
),
self
.
max_lost_packets
))
promise_success
=
False
# Check for network errors
if
total_errors
/
total_MB
>=
self
.
max_error_messages
:
self
.
logger
.
error
(
"Network errors reached critical threshold: %s "
\
" (threshold is %s per MB)"
%
(
math
.
ceil
(
total_errors
/
total_MB
),
self
.
max_error_messages
))
" (threshold is %s per MB)"
%
(
int
(
math
.
ceil
(
total_errors
/
total_MB
)
),
self
.
max_error_messages
))
promise_success
=
False
if
promise_success
:
...
...
slapos/promise/plugin/check_network_transit.py
View file @
a721147c
from
__future__
import
division
import
json
import
os
import
psutil
...
...
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