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
Lu Xu
slapos.toolbox
Commits
fbcba5b3
Commit
fbcba5b3
authored
Mar 19, 2019
by
Łukasz Nowak
Committed by
Łukasz Nowak
Mar 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promise/plugin: Support ATS with traffic_ctl
/reviewed-on
!53
parent
cfdbaaf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
slapos/promise/plugin/trafficserver_cache_availability.py
slapos/promise/plugin/trafficserver_cache_availability.py
+13
-3
No files found.
slapos/promise/plugin/trafficserver_cache_availability.py
View file @
fbcba5b3
...
@@ -19,10 +19,20 @@ class RunPromise(GenericPromise):
...
@@ -19,10 +19,20 @@ class RunPromise(GenericPromise):
"""
"""
Check trafficserver cache availability
Check trafficserver cache availability
"""
"""
traffic_line
=
self
.
getConfig
(
'wrapper-path'
)
wrapper
=
self
.
getConfig
(
'wrapper-path'
)
if
'traffic_line'
in
wrapper
:
args
=
[
wrapper
,
'-r'
,
'proxy.node.cache.percent_free'
]
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: %s"
else
:
self
.
logger
.
error
(
"Wrapper %r not supported."
%
(
wrapper
,))
return
process
=
subprocess
.
Popen
(
process
=
subprocess
.
Popen
(
[
traffic_line
,
'-r'
,
'proxy.node.cache.percent_free'
]
,
args
,
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
)
)
...
@@ -30,7 +40,7 @@ class RunPromise(GenericPromise):
...
@@ -30,7 +40,7 @@ class RunPromise(GenericPromise):
if
process
.
returncode
==
0
:
if
process
.
returncode
==
0
:
self
.
logger
.
info
(
"OK"
)
self
.
logger
.
info
(
"OK"
)
else
:
else
:
self
.
logger
.
error
(
"Cache not available, availability: %s"
%
result
)
self
.
logger
.
error
(
message
%
(
result
,)
)
def
anomaly
(
self
):
def
anomaly
(
self
):
"""
"""
...
...
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