Skip to content

Remove trailing slash from request to retrieve all tags#230

Merged
koalalorenzo merged 2 commits intokoalalorenzo:masterfrom
schwartzie:fix_get_all_tags
Nov 29, 2017
Merged

Remove trailing slash from request to retrieve all tags#230
koalalorenzo merged 2 commits intokoalalorenzo:masterfrom
schwartzie:fix_get_all_tags

Conversation

@schwartzie
Copy link
Copy Markdown
Contributor

Calls to Manager.get_all_tags() started throwing a NotFoundError for me.

I turned on logging and confirmed that the call to https://api.digitalocean.com/v2/tags/?per_page=200 is returning a 404. I validated this by directly submitting the request:

$ curl "https://api.digitalocean.com/v2/tags/?per_page=200" \ 
   -H "Authorization: Bearer <token>"
{"error":"route not found","root_causes":[]}

Removing the trailing slash from the request returned the expected response object both in curl and through the library.

This is also consistent with the API documentation:

To list all of your tags, you can send a GET request to /v2/tags.

@koalalorenzo
Copy link
Copy Markdown
Owner

I am not sure why the tests are failing, could you update them in case those keep failing?

@koalalorenzo koalalorenzo self-requested a review November 29, 2017 18:21
@schwartzie
Copy link
Copy Markdown
Contributor Author

It looks like the request being made in the test to validate the library's output had the same problem with the trailing slash. I've pushed an update to the test as well now.

@koalalorenzo koalalorenzo merged commit e09b5f3 into koalalorenzo:master Nov 29, 2017
mioi pushed a commit to mioi/python-digitalocean that referenced this pull request Oct 11, 2018
This was fixed for the `get_all_tags()` function in PR koalalorenzo#230, but was not
fixed for the function to create new tags.

creating new tags is resulting in a `NotFoundError` exception. This
should fix it.
@schwartzie schwartzie deleted the fix_get_all_tags branch February 6, 2021 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants