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
Thomas Gambier
slapos.core
Commits
827a3104
Commit
827a3104
authored
Mar 22, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.erp5.org/repos/slapos.core
parents
a26305a2
e601164d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
CHANGES.txt
CHANGES.txt
+1
-1
slapos/slap/slap.py
slapos/slap/slap.py
+13
-3
No files found.
CHANGES.txt
View file @
827a3104
...
...
@@ -4,7 +4,7 @@ Changes
0.24 (Unreleased)
-----------------
*
No change yet.
*
Handles different errors in a user friendly way [Cedric de Saint Martin]
0.23 (2012-02-29)
-----------------
...
...
slapos/slap/slap.py
View file @
827a3104
...
...
@@ -465,9 +465,13 @@ class ComputerPartition(SlapDocument):
# return decorated
class
ConnectionHelper
:
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:"
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 "
\
"check that certificate and key defined in slapos.cfg exist and are "
\
"valid. "
def
__init__
(
self
,
connection_wrapper
,
host
,
path
,
key_file
=
None
,
cert_file
=
None
,
master_ca_file
=
None
,
timeout
=
None
):
self
.
connection_wrapper
=
connection_wrapper
...
...
@@ -501,6 +505,9 @@ your machine and that the server is available. The original error was:"
self
.
connect
()
self
.
connection
.
request
(
'GET'
,
self
.
path
+
path
)
self
.
response
=
self
.
connection
.
getresponse
()
# If ssl error : must come from bad configuration
except
ssl
.
SSLError
,
e
:
raise
ssl
.
SSLError
(
self
.
ssl_error_message_connect_fail
+
str
(
e
))
except
socket
.
error
,
e
:
raise
socket
.
error
(
self
.
error_message_connect_fail
+
str
(
e
))
# check self.response.status and raise exception early
...
...
@@ -528,6 +535,9 @@ your machine and that the server is available. The original error was:"
header_dict
=
{
'Content-type'
:
content_type
}
self
.
connection
.
request
(
"POST"
,
self
.
path
+
path
,
urllib
.
urlencode
(
parameter_dict
),
header_dict
)
# If ssl error : must come from bad configuration
except
ssl
.
SSLError
,
e
:
raise
ssl
.
SSLError
(
self
.
ssl_error_message_connect_fail
+
str
(
e
))
except
socket
.
error
,
e
:
raise
socket
.
error
(
self
.
error_message_connect_fail
+
str
(
e
))
self
.
response
=
self
.
connection
.
getresponse
()
...
...
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