coxley / nsot_sync

CLI/Driver-based framework to sync resources to NSoT (IPAM/CMDB)
1 stars 3 forks source link

Simple driver crashes on Darwin #2

Closed jathanism closed 8 years ago

jathanism commented 8 years ago

Mac OS 10.11.3

$ uname -a
Darwin jathy.local 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

Fails with:

$ nsot_sync simple
SUCCESS: desc created!
SUCCESS: desc created!
SUCCESS: desc created!
Traceback (most recent call last):
  File "/Users/jathan/sandbox/virtualenvs/pynsot/bin/nsot_sync", line 11, in <module>
    sys.exit(main())
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/cli.py", line 93, in main
    cli(obj={})  # obj is for sharing things between click contexts
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/commands/simple.py", line 22, in cli
    driver.handle_resources()
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/drivers/base_driver.py", line 67, in handle_resources
    resources = self.get_resources()
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/drivers/simple.py", line 55, in get_resources
    resources_to_create.update(self.get_networks_and_interfaces())
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/drivers/simple.py", line 78, in get_networks_and_interfaces
    for net_resources, intf_resource in self.intf_fetch(intf):
  File "/Users/jathan/sandbox/virtualenvs/pynsot/lib/python2.7/site-packages/nsot_sync/drivers/simple.py", line 99, in intf_fetch
    mac_addr = families[netifaces.AF_LINK][0]['addr']
KeyError: 18

It created Attributes, but pooped out:

$ nsot changes list -l 3
+-------------------------------------------------------------------------+
| ID     Change At             User              Event    Resource    Obj |
+-------------------------------------------------------------------------+
| 8418   2016-02-24 12:54:51   admin@localhost   Create   Attribute   15  |
| 8417   2016-02-24 12:54:51   admin@localhost   Create   Attribute   14  |
| 8416   2016-02-24 12:54:51   admin@localhost   Create   Attribute   13  |
+-------------------------------------------------------------------------+