packethost / packet-python

A Python client for the Equinix Metal API
http://metal.equinix.com/
GNU Lesser General Public License v3.0
40 stars 50 forks source link

fix metros URL with correct prefix path #123

Closed displague closed 2 years ago

displague commented 3 years ago

Fixes #122

Signed-off-by: Marques Johansson mjohansson@equinix.com

displague commented 3 years ago

Before:

$ python3
Python 3.9.6 (default, Jun 29 2021, 05:25:02)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import packet
>>> c = packet.Manager(auth_token="secret")
>>> c.list_metros()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/marques/src/packet-python/packet/Manager.py", line 46, in list_metros
    data = self.call_api("metros", params=params)
  File "/Users/marques/src/packet-python/packet/Manager.py", line 32, in call_api
    return super(Manager, self).call_api(method, type, params)
  File "/Users/marques/src/packet-python/packet/baseapi.py", line 116, in call_api
    raise ResponseError(resp, data)
packet.baseapi.ResponseError: Error 404: Not found
>>>

After:

...
>>> c.list_metros()[0].code
'dc'
displague commented 3 years ago

I'm not sure how we can disable the Drone builds. Any thoughts, @mmlb?