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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.toolbox
Commits
831075b1
Commit
831075b1
authored
Nov 27, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pylint
parent
8e54e341
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
14 deletions
+4
-14
slapos/promise/check_web_page_http_cache_hit/__init__.py
slapos/promise/check_web_page_http_cache_hit/__init__.py
+0
-8
slapos/promise/plugin/backupserver_check_backup.py
slapos/promise/plugin/backupserver_check_backup.py
+0
-1
slapos/promise/plugin/check_free_disk_space.py
slapos/promise/plugin/check_free_disk_space.py
+2
-2
slapos/qemuqmpclient/__init__.py
slapos/qemuqmpclient/__init__.py
+2
-2
slapos/test/test_checkfeedaspromise.py
slapos/test/test_checkfeedaspromise.py
+0
-1
No files found.
slapos/promise/check_web_page_http_cache_hit/__init__.py
View file @
831075b1
...
...
@@ -49,14 +49,6 @@ def checkWebpageHttpCacheHit(url_list, resolve_list=[], cookie_jar_path=None):
if
attr
[
0
]
==
"href"
:
handle_url
(
attr
[
1
])
headers
=
{
"User-Agent"
:
"test"
,
"Accept-Encoding"
:
"gzip, deflate"
,
"Accept"
:
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
,
"Accept-Language"
:
"en-US,en;q=0.5"
,
# "Connection": "keep-alive"
}
parsed_url_dict
=
set
()
def
do_request
(
url
):
if
url
in
parsed_url_dict
:
return
...
...
slapos/promise/plugin/backupserver_check_backup.py
View file @
831075b1
from
zope.interface
import
implementer
from
slapos.grid.promise
import
interface
from
slapos.grid.promise.generic
import
GenericPromise
from
slapos.grid.promise.generic
import
TestResult
import
re
import
pytz
...
...
slapos/promise/plugin/check_free_disk_space.py
View file @
831075b1
...
...
@@ -171,8 +171,8 @@ class RunPromise(GenericPromise):
return
free_space
=
round
(
free_space
/
(
1024
*
1024
*
1024
),
2
)
self
.
logger
.
error
(
'Free disk space low: remaining %s G (threshold: %s G)'
%
(
free_space
,
threshold
)
)
self
.
logger
.
error
(
'Free disk space low: remaining %s G (threshold: %s G)'
,
free_space
,
threshold
)
def
test
(
self
):
return
self
.
_test
(
result_count
=
1
,
failure_amount
=
1
)
...
...
slapos/qemuqmpclient/__init__.py
View file @
831075b1
...
...
@@ -407,7 +407,7 @@ class QemuQMPWrapper(object):
self
.
powerdown
()
system_exited
=
False
# wait for ~10 seconds if the system exit, else quit Qemu
for
i
in
range
(
0
,
5
):
for
_
in
range
(
0
,
5
):
for
event
in
self
.
getEventList
(
timeout
=
2
,
cleanup
=
True
):
if
event
[
'event'
]
==
'SHUTDOWN'
:
# qemu is about to exit
...
...
@@ -569,7 +569,7 @@ class QemuQMPWrapper(object):
return
if
mem_size
<
0
:
raise
ValueError
(
"Memory size is not valid: %s"
%
option_dict
)
raise
ValueError
(
"Memory size is not valid: %s"
%
mem_size
)
elif
current_size
>
mem_size
:
# Request to remove memory
to_remove_size
=
current_size
-
mem_size
...
...
slapos/test/test_checkfeedaspromise.py
View file @
831075b1
import
datetime
import
feedparser
import
unittest
import
PyRSS2Gen
as
RSS2
...
...
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