netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
563 stars 168 forks source link

python2.6: ValueError: zero length field name in format #54

Closed tiago-cruz-movile closed 6 years ago

tiago-cruz-movile commented 6 years ago

Hello,

Is pynetbox supposed to work with python2.6 (CentOS6?)

example:

[tiago.cruz@mordor env]$ pip install pynetbox
Collecting pynetbox
Collecting netaddr==0.7.18 (from pynetbox)
  Using cached https://files.pythonhosted.org/packages/04/9c/46c719f026dc87822ccce2530049f3c0865e85307b7ab50beb28008e10c0/netaddr-0.7.18-py2.py3-none-any.whl
Collecting requests==2.10.0 (from pynetbox)
  Using cached https://files.pythonhosted.org/packages/99/b4/63d99ba8e189c47d906b43bae18af4396e336f2b1bfec86af31efe2d2cb8/requests-2.10.0-py2.py3-none-any.whl
Collecting six==1.11.0 (from pynetbox)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: netaddr, requests, six, pynetbox
Successfully installed netaddr-0.7.18 pynetbox-3.3.1 requests-2.10.0 six-1.11.0
[tiago.cruz@mordor env]$ python
Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pynetbox
>>> nb = pynetbox.api(
...     'http://netbox.acme.com',
...     token='xd6xf3x2dx987x70x4xf'
... )
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/tmp/teste/env/lib/python2.6/site-packages/pynetbox/api.py", line 88, in __init__
    base_url = "{}/api".format(url)
ValueError: zero length field name in format
>>>
zachmoody commented 6 years ago

Hrm, don't think so, {} is used pretty liberally throughout the library which would preclude using the 2.6 interpreter.