Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoE plugin crashes inventory job if type of netbox is unknown #1616

Closed
lunkwill42 opened this issue Nov 15, 2017 · 0 comments
Closed

PoE plugin crashes inventory job if type of netbox is unknown #1616

lunkwill42 opened this issue Nov 15, 2017 · 0 comments
Assignees
Labels

Comments

@lunkwill42
Copy link
Member

This line causes the inventory job to crash for a device that has no know type yet (as may happen on the first collection run):

https://github.com/UNINETT/nav/blob/9288d2f87d6993b1ea21616ac731955e8b3a99ea/python/nav/ipdevpoll/plugins/poe.py#L38

From the log

2017-11-15 15:45:50,806 [ERROR jobs.jobhandler] [statuscheck ] Plugin nav.ipdevpoll.plugins.poe.Poe(u'') reported an unhandled failure
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 653, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/source/python/nav/ipdevpoll/jobs.py", line 222, in next_plugin
    df = defer.maybeDeferred(plugin_instance.handle)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1532, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/source/python/nav/ipdevpoll/plugins/poe.py", line 38, in handle
    if self.netbox.type.vendor.id == 'cisco':
exceptions.AttributeError: 'NoneType' object has no attribute 'vendor'

This is on the master branch, not on a release yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant