[PDB-tech] peeringdb python library
Stefan Pratter
stefan at 20c.com
Fri Feb 26 06:53:32 PST 2016
Depending on when you did the initial sync, we may have done a full
re-import of v1 data since then which means some ids may have changed,
Is it feasible for you to wipe your local db and do fresh peeringdb sync
? I just did a sync (and re-sync) on a fresh db and had no problems.
As for peeringdb get net433 not working, i can confirm that this appears
to be broken - i was able to reproduce it, will need to investigate
further.
Thanks for the feedback,
Stefan
On 26/02/16 16:33, Jeroen Valcke wrote:
> 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-
>
>
> _______________________________________________
> Pdb-tech mailing list
> Pdb-tech at lists.peeringdb.com
> http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
>
More information about the Pdb-tech
mailing list