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
Rafael Monnerat
slapos.toolbox
Commits
470da70c
Commit
470da70c
authored
Oct 01, 2018
by
Guillaume Hervier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytest.slaprunner: Add error log when contacting slaprunner.
/reviewed-on
nexedi/slapos.toolbox!38
parent
ed7f5603
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
slapos/resiliencytest/suites/slaprunner.py
slapos/resiliencytest/suites/slaprunner.py
+13
-9
No files found.
slapos/resiliencytest/suites/slaprunner.py
View file @
470da70c
...
@@ -85,15 +85,19 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
...
@@ -85,15 +85,19 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
Connect through HTTP to the slaprunner instance.
Connect through HTTP to the slaprunner instance.
Require self.slaprunner_backend_url to be set.
Require self.slaprunner_backend_url to be set.
"""
"""
url
=
"%s/%s"
%
(
self
.
slaprunner_backend_url
,
resource
)
try
:
if
data
:
url
=
"%s/%s"
%
(
self
.
slaprunner_backend_url
,
resource
)
result
=
self
.
_opener_director
.
open
(
url
,
data
=
data
)
if
data
:
else
:
result
=
self
.
_opener_director
.
open
(
url
,
data
=
data
)
result
=
self
.
_opener_director
.
open
(
url
)
else
:
result
=
self
.
_opener_director
.
open
(
url
)
if
result
.
getcode
()
is
not
200
:
if
result
.
getcode
()
is
not
200
:
raise
NotHttpOkException
(
result
.
getcode
())
raise
NotHttpOkException
(
result
.
getcode
())
return
result
.
read
()
return
result
.
read
()
except
urllib2
.
HTTPError
:
self
.
logger
.
error
(
'Error when contacting slaprunner at URL: {}'
.
format
(
url
))
raise
def
_login
(
self
):
def
_login
(
self
):
self
.
logger
.
debug
(
'Logging in...'
)
self
.
logger
.
debug
(
'Logging in...'
)
...
@@ -208,7 +212,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
...
@@ -208,7 +212,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
)
)
data
=
json
.
loads
(
data
)
data
=
json
.
loads
(
data
)
if
data
[
'code'
]
==
0
:
if
data
[
'code'
]
==
0
:
self
.
logger
.
warning
(
data
[
'result'
])
self
.
logger
.
warning
(
data
[
'result'
])
except
(
NotHttpOkException
,
urllib2
.
HTTPError
):
except
(
NotHttpOkException
,
urllib2
.
HTTPError
):
# cloning can be very long.
# cloning can be very long.
...
...
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