mapbox / tilesets-cli

CLI for interacting with the Mapbox Tilesets API and Mapbox Tiling Service
https://docs.mapbox.com/mapbox-tiling-service
BSD 2-Clause "Simplified" License
125 stars 27 forks source link

Tilesets-cli raises an error on successful source delete #52

Closed cetooley closed 4 years ago

cetooley commented 4 years ago

Hello! I found what I think is a bug with tilesets-cli:

(for: tilesets-1.0.0.dev0)

When making a request with tilesets-cli to delete a source (i.e. tilesets delete-source ...) tilesets-cli raises a TilesetsError upon a successful deletion.

Looking at cli.py, the response status code is expected to be 201 for a successful delete when the mapbox api documentation states 204 is the response for a successful deletion: https://docs.mapbox.com/api/maps/#response-delete-a-tileset-source

Doing some rudimentary hacking suggests a fix would be to modify delete_source to expect a 204 status_code on Line 387 instead of 201: https://github.com/mapbox/tilesets-cli/blob/master/mapbox_tilesets/scripts/cli.py#L387

I would expect a successful request would not raise any errors, so I think this is a bug :)

flippmoke commented 4 years ago

This should now be fixed and is released in v1.0.1-dev0