benkonrath / transip-api

Python implementation for the TransIP API
https://transip-api.readthedocs.io/en/latest/
MIT License
23 stars 23 forks source link

added optional support for suds_requests #23

Closed wolph closed 6 years ago

wolph commented 6 years ago

added optional support for suds_requests to work around ssl errors for pre-2.7.9 python versions

benkonrath commented 6 years ago

Looks good. Could you include some documentation that suds_requests is also an option?

Do you have any idea about the test failure?

wolph commented 6 years ago

Sure, I'll add some docs :)

As for the test failure, I think it's caused by a newer version of pylint, I see a few changes related to inconsistent-return-statements in their changelog: https://docs.pylint.org/en/latest/whatsnew/changelog.html

benkonrath commented 6 years ago

Ok, I guess I'll have to sort the failure. I'll probably just pin the version of pylint to the older one.

wolph commented 6 years ago

Well, I think it's an easy fix in this case, the _sign method has a return within an if statement and no return outside of it. Perhaps it should be replaced with a RuntimeError() or something?

https://github.com/benkonrath/transip-api/blob/afb45dfbe09a06a76cba0fd5c9c162166d1bfc3b/transip/client.py#L49-L62

benkonrath commented 6 years ago

Ah ok, cool. Thanks for the tip. I was just being lazy. :-) Give me a few minutes.

benkonrath commented 6 years ago

You can rebase to get the pylint fix. Thanks for your help with that.

Ok, I see why you want to use suds_requests instead of suds-jurko. Do you think it would be better to switch to using suds_requests by default and drop suds-jurko?

wolph commented 6 years ago

It's rebased :) Github certainly makes that convoluted process through the webinterface... create a pull request to your own repo to rebase after. Weird...

As for the suds-jurko vs. suds_requests, it's not a replacement but an addon. I suppose suds-jurko is still less broken that suds is but using requests in the background (instead of urllib2) makes it a lot more manageable.

Personally I would have liked SOAP to have died a long time ago, yet... here we are :( If you're going to switch to anything than I'd recommend trying Zeep instead: http://docs.python-zeep.org/en/master/

benkonrath commented 6 years ago

Ok, got it. I don't like SOAP either. I asked TransIP for a REST API and they said they don't plan to do this ... hello 1995! :-)

I inherited this project from the original author and I only have time for maintenance. Nonetheless, I created an issue for the suds to zeep conversion in case somebody (maybe me) feels like taking this on. Thanks for your input.

wolph commented 6 years ago

For now everything is working anyhow, I don't think it's worth the effort :)

I personally think transip needs to trash the current API and replace it with an Open API type of thing (possibly using swagger: https://swagger.io/) and while they're at it, replace PHP with a properly designed programming language. But... not our call I suppose ;)

shirshir commented 6 years ago

I asked transip support after finding https://api.transip.nl/json/. They said they are working on it.