Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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.core
Commits
028b4ffd
Commit
028b4ffd
authored
Apr 02, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be user friendly if SSL timed out
parent
90fa6e8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
slapos/slap/slap.py
slapos/slap/slap.py
+6
-3
No files found.
slapos/slap/slap.py
View file @
028b4ffd
...
...
@@ -476,11 +476,12 @@ class ComputerPartition(SlapDocument):
# return decorated
class
ConnectionHelper
:
error_message_timeout
=
"
\
n
The connection timed out. Please try again later."
error_message_connect_fail
=
"Couldn't connect to the server. Please "
\
"double check given master-url argument, and make sure that IPv6 is "
\
"enabled on your machine and that the server is available. The "
\
"original error was: "
ssl_error_message_connect_fail
=
"
Couldn't authenticate computer. Please "
\
ssl_error_message_connect_fail
=
"
\
n
Couldn't authenticate computer. Please "
\
"check that certificate and key defined in slapos.cfg exist and are "
\
"valid. "
def
__init__
(
self
,
connection_wrapper
,
host
,
path
,
key_file
=
None
,
...
...
@@ -516,9 +517,11 @@ class ConnectionHelper:
self
.
connect
()
self
.
connection
.
request
(
'GET'
,
self
.
path
+
path
)
self
.
response
=
self
.
connection
.
getresponse
()
# If ssl error : m
ust
come from bad configuration
# If ssl error : m
ay
come from bad configuration
except
ssl
.
SSLError
,
e
:
raise
ssl
.
SSLError
(
self
.
ssl_error_message_connect_fail
+
str
(
e
))
if
e
.
message
==
"The read operation timed out"
:
raise
socket
.
error
(
str
(
e
)
+
self
.
error_message_timeout
)
raise
ssl
.
SSLError
(
str
(
e
)
+
self
.
ssl_error_message_connect_fail
)
except
socket
.
error
,
e
:
raise
socket
.
error
(
self
.
error_message_connect_fail
+
str
(
e
))
# check self.response.status and raise exception early
...
...
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