Skip to content

Sorting lambda functions crash #3

@altf4

Description

@altf4

The sorting functions at lines 112 and 113 fail for me, with a stack trace as follows:

Sorting hosts to targeting printers first, and laptops last
Traceback (most recent call last):
  File "./nacker", line 156, in <module>
    main(sys.argv)
  File "./nacker", line 111, in main
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
  File "./nacker", line 111, in <lambda>
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
  File "/usr/lib/python2.7/dist-packages/netaddr/eui/__init__.py", line 464, in oui
    return OUI(self.value >> 24)
  File "/usr/lib/python2.7/dist-packages/netaddr/eui/__init__.py", line 121, in __init__
    raise NotRegisteredError('OUI %r not registered!' % oui)
netaddr.core.NotRegisteredError: OUI 13164779 not registered!

Relevant code:

    # Sort the MAC addresses based on organization, laptops and workstations
    print('Sorting hosts to targeting printers first, and laptops last')
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
    hosts.sort(key = lambda host: host[1].oui.registration().org in PRINTER_MANUFACTURERS, reverse=True)

(Running from an Ubuntu 14.04 machine.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions