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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
b3a67078
Commit
b3a67078
authored
Jul 26, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
3441bf43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
slapos/promise/plugin/trafficserver_cache_availability.py
slapos/promise/plugin/trafficserver_cache_availability.py
+2
-2
slapos/promise/plugin/validate_frontend_configuration.py
slapos/promise/plugin/validate_frontend_configuration.py
+7
-9
No files found.
slapos/promise/plugin/trafficserver_cache_availability.py
View file @
b3a67078
...
...
@@ -21,10 +21,10 @@ class RunPromise(GenericPromise):
if
'traffic_line'
in
wrapper
:
args
=
[
wrapper
,
'-r'
,
'proxy.node.cache.percent_free'
]
message
=
"Cache not available, availability:"
message
=
"Cache not available, availability:
%s
"
elif
'traffic_ctl'
in
wrapper
:
args
=
[
wrapper
,
'metric'
,
'get'
,
'proxy.process.cache.percent_full'
]
message
=
"Cache not available, occupation:"
message
=
"Cache not available, occupation:
%s
"
else
:
self
.
logger
.
error
(
"Wrapper %r not supported."
%
(
wrapper
,))
return
...
...
slapos/promise/plugin/validate_frontend_configuration.py
View file @
b3a67078
...
...
@@ -21,16 +21,14 @@ class RunPromise(GenericPromise):
validate_script
=
self
.
getConfig
(
'verification-script'
)
if
not
validate_script
:
raise
ValueError
(
"'verification-script' was not set in promise parameters."
)
process
=
subprocess
.
Popen
(
[
validate_script
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
)
message
=
process
.
communicate
()[
0
]
if
process
.
returncode
==
0
:
self
.
logger
.
info
(
"OK"
)
try
:
subprocess
.
check_output
(
validate_script
,
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
e
:
message
=
e
.
output
self
.
logger
.
error
(
message
if
str
is
bytes
else
message
.
decode
(
'utf-8'
,
'replace'
))
else
:
self
.
logger
.
error
(
message
)
self
.
logger
.
info
(
"OK"
)
def
anomaly
(
self
):
return
self
.
_anomaly
(
result_count
=
1
,
failure_amount
=
1
)
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