On Thu, 3 Jul 2014 15:03:10 -0300 Bruno Galindro da Costa bruno.galindro@gmail.com wrote:
This is the error reported by ipdevpolld when I execute it in a netbox:
[snip]
Caught exception during save. Last manager = None. Last model = None Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/jobs.py", line 409, in perform_save self._log_containers("containers before save") File "/usr/lib/python2.7/dist-packages/nav/ipdevpoll/jobs.py", line 439, in _log_containers pprint.pformat(dict(self.containers))) File "/usr/lib/python2.7/pprint.py", line 60, in pformat return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object) File "/usr/lib/python2.7/pprint.py", line 119, in pformat self._format(object, sio, 0, 0, {}, 0) File "/usr/lib/python2.7/pprint.py", line 137, in _format rep = self._repr(object, context, level - 1) File "/usr/lib/python2.7/pprint.py", line 230, in _repr self._depth, level) File "/usr/lib/python2.7/pprint.py", line 242, in format return _safe_repr(object, context, maxlevels, level) File "/usr/lib/python2.7/pprint.py", line 286, in _safe_repr vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level) File "/usr/lib/python2.7/pprint.py", line 284, in _safe_repr for k, v in _sorted(object.items()): File "/usr/lib/python2.7/pprint.py", line 79, in _sorted return sorted(iterable) File "/usr/lib/python2.7/dist-packages/IPy.py", line 745, in __eq__ return self.__cmp__(other) == 0 File "/usr/lib/python2.7/dist-packages/IPy.py", line 708, in __cmp__ if self._prefixlen < other.prefixlen(): AttributeError: 'macAddress' object has no attribute 'prefixlen'
This seems to be a rather embarrassing bug in IPy.
(Tech description: The IP class implementation naively assumes IP objects will only ever be compared with other IP objects, which in practice is not true. Witness it here being compared to macAddress objects during pretty-print formatting in Python's pprint module).
This pretty-printing only occurs in ipdevpoll when you have enabled DEBUG-level logging for the "nav.ipdevpoll.jobs.jobhandler-queue" logger. Unless you have a specific reason for running with DEBUG level logging on all parts of NAV, reconfiguring your logging levels would mitigate this.
Debian Wheezy appears to ship with IPy 0.75, whereas the bug seems to have been fixed in the 0.80 release. Version 0.81 is available in Debian testing (Jessie), so you could also fix the bug by installing the python-ipy package from there.