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
Joanne Hugé
slapos.toolbox
Commits
55f21858
Commit
55f21858
authored
Apr 21, 2022
by
Thomas Gambier
Committed by
Thomas Gambier
Apr 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytest: supports python3
parent
ca3341d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
slapos/resiliencytest/suites/slaprunner.py
slapos/resiliencytest/suites/slaprunner.py
+3
-2
slapos/runner/views.py
slapos/runner/views.py
+2
-2
No files found.
slapos/resiliencytest/suites/slaprunner.py
View file @
55f21858
...
...
@@ -36,6 +36,7 @@ import random
import
ssl
import
string
import
time
from
slapos.util
import
bytes2str
,
str2bytes
from
six.moves.urllib.request
import
HTTPCookieProcessor
,
HTTPSHandler
,
\
build_opener
from
six.moves.urllib.error
import
HTTPError
...
...
@@ -89,7 +90,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
try
:
url
=
"%s/%s"
%
(
self
.
slaprunner_backend_url
,
resource
)
if
data
:
result
=
self
.
_opener_director
.
open
(
url
,
data
=
data
)
result
=
self
.
_opener_director
.
open
(
url
,
data
=
str2bytes
(
data
)
)
else
:
result
=
self
.
_opener_director
.
open
(
url
)
...
...
@@ -102,7 +103,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
def
_login
(
self
):
self
.
logger
.
debug
(
'Logging in...'
)
b64string
=
base64
.
encodestring
(
'%s:%s'
%
(
self
.
slaprunner_user
,
self
.
slaprunner_password
))[:
-
1
]
b64string
=
base64
.
b64encode
((
'%s:%s'
%
(
self
.
slaprunner_user
,
self
.
slaprunner_password
)).
encode
()).
decode
()
self
.
_opener_director
.
addheaders
=
[
(
'Authorization'
,
'Basic %s'
%
b64string
),
# By default we will prefer to receive JSON to simplify
...
...
slapos/runner/views.py
View file @
55f21858
...
...
@@ -244,13 +244,13 @@ def viewLog():
return
render_template
(
'viewLog.html'
)
def
getFileLog
():
logfile
=
request
.
form
.
get
(
'filename'
,
''
)
.
encode
(
'utf-8'
)
logfile
=
request
.
form
.
get
(
'filename'
,
''
)
if
logfile
==
"instance.log"
:
file_path
=
app
.
config
[
'instance_log'
]
elif
logfile
==
"software.log"
:
file_path
=
app
.
config
[
'software_log'
]
else
:
file_path
=
realpath
(
app
.
config
,
logfile
)
file_path
=
realpath
(
app
.
config
,
logfile
.
encode
(
'utf-8'
)
)
try
:
if
not
os
.
path
.
exists
(
file_path
):
raise
IOError
...
...
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