koalalorenzo / python-digitalocean

🐍🐳 Python module to manage Digital Ocean droplets
GNU Lesser General Public License v3.0
1.25k stars 300 forks source link

Fix trailing slashes for LoadBalancer and Certificate APIs #324

Closed thiagoferreiraw closed 3 years ago

thiagoferreiraw commented 3 years ago

Context

Proposed solution

I updated the API paths according to the official digital ocean docs:

https://developers.digitalocean.com/documentation/v2/#load-balancers https://developers.digitalocean.com/documentation/v2/#certificates

Integration tests

I suggest using this simple script to perform requests on the API. you can also run the script on this branch and also on master to assure the behavior is fixed.

import os
import digitalocean
DIGITALOCEAN_API_TOKEN = os.environ.get("DIGITALOCEAN_API_TOKEN")
LOAD_BALANCER_NAME = "lb-api-sandbox" # Change this to a load balancer in your account
do = digitalocean.Manager(token=DIGITALOCEAN_API_TOKEN)
lbs = do.get_all_load_balancers()
lb = list(filter(lambda x: x.name == LOAD_BALANCER_NAME, lbs))[0]
lb.save()
thiagoferreiraw commented 3 years ago

Hey @koalalorenzo / @andrewsomething !

Can you take a look at this pull request, please?

Thanks a lot!

thiagoferreiraw commented 3 years ago

Thanks a lot @koalalorenzo !

I didn't find much info about the release cycle, do you have an eta to release this fix to pypi?

koalalorenzo commented 3 years ago

I will do something during this weekend. I think I started importing this on GitLab, but I didn't finish it :O