[PDB-tech] peeringdb python library

Jeroen Valcke jvalcke at opendns.com
Fri Feb 26 06:33:31 PST 2016


Hi,

I've been giving the peeringdb python module a try. I ran into a couple of
issues, perhaps somebody can help me out here. I'm using peeringdb, version
0.4.2

- sync issue, "peeringdb sync" throws an error. I don't think I got this on
the initial sync

  File
"/usr/local/lib/python2.7/dist-packages/django_peeringdb/management/commands/pdb_sync.py",
line 127, in update_db
    sync.sync_obj(cls, row)
  File "/usr/local/lib/python2.7/dist-packages/django_peeringdb/sync.py",
line 25, in sync_obj
    obj.full_clean()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py",
line 1171, in full_clean
    raise ValidationError(errors)
django.core.exceptions.ValidationError: {'org': [u'organization instance
with id 4755 does not exist.']}

- Errors on existing net objects. I keep getting errors when trying to
retrieve net objects. For example
$ peeringdb get net433
...
  File "/usr/local/lib/python2.7/dist-packages/twentyc/rpc/client.py", line
88, in _load
    self._throw(res, data)
  File "/usr/local/lib/python2.7/dist-packages/twentyc/rpc/client.py", line
68, in _throw
    raise NotFoundException("%d %s" % (res.status_code, err))
twentyc.rpc.client.NotFoundException: 404 Unknown

Org 433 is present in the local db
mysql> select id, name, asn  from peeringdb_network where id=433;
+-----+-------------+-------+
| id  | name        | asn   |
+-----+-------------+-------+
| 433 | Google Inc. | 15169 |
+-----+-------------+-------+
1 row in set (0.00 sec)

- Is it possible to output all net objects on the cli?
    peeringdb get net --> doesn't work

It seems to work in the client

>>> from peeringdb.client import PeeringDB
>>> pdb = PeeringDB()
>>> pdb.all('net')
...


Thanks,
-Jeroen-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.peeringdb.com/pipermail/pdb-tech/attachments/20160226/4b344852/attachment.html>


More information about the Pdb-tech mailing list