Oved Ourfali has posted comments on this change.

Change subject: sdk: throw error when connecting to ssl site using http protocol
......................................................................


Patch Set 1: (3 inline comments)

....................................................
File src/codegen/entrypoint/entrypoint.py
Line 186:                                     url='/api',
Line 187:                                     headers={'Filter': filter})
Line 188: 
Line 189:         # If server returns no response for the root resource, this 
is sign
Line 190:         # that used http protocol against SSL secured site
I'd rephrase:
If the server doesn't return a response for the root resource, then it means we 
used http protocol against SSL secured site
Line 191:         if type(entry_point) == types.StringType and entry_point == 
'':
Line 192:             raise UnsecuredConnectionAttemptError
Line 193: 
Line 194:         # Store entry point to the context


....................................................
File src/ovirtsdk/api.py
Line 88: 
Line 89:         # If server returns no response for the root resource, this is 
sign
Line 90:         # that used http protocol against SSL secured site
Line 91:         if type(entry_point) == types.StringType and entry_point == '':
Line 92:             raise UnsecuredConnectionAttemptError
can you factor out this call somewhere? you're doing the test in two different 
locations.
Line 93: 
Line 94:         # Store entry point to the context
Line 95:         contextmanager.add('entry_point', entry_point, Mode.R)
Line 96: 


....................................................
File src/ovirtsdk/infrastructure/errors.py
Line 31: 
Line 32: class UnsecuredConnectionAttemptError(Exception):
Line 33:     def __init__(self):
Line 34:         Exception.__init__(self, "[ERROR]::server returned no 
response, this may happen if you trying\n" +
Line 35:                                  "connect to SSL secured site using 
http protocol.")
I'd rephrase:
No response returned from server. If you're using HTTP protocol against a SSL 
secured server, then try using HTTPS instead.
Line 36: 
Line 37: class RequestError(Exception):
Line 38:     def __init__(self, response):
Line 39:         self.detail = None


--
To view, visit http://gerrit.ovirt.org/7904
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a486f0b6dd8b2136d4cee911b9cea18b589e74b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to