Add missing N/A fallback on DIMM memory #129

Merged
cyrinux merged 1 commit from fix_memory_inventory into master 2020-06-09 09:05:36 +02:00
cyrinux commented 2020-06-08 13:05:30 +02:00 (Migrated from github.com)

Fix

DEBUG:urllib3.connectionpool:https://netbox:443 "GET /api/dcim/manufacturers/?name=HP HTTP/1.1" 200 155
{'description': 'DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)',
 'id': 'bank:0',
 'product': None,
 'serial': 'N/A',
 'size': 8.0,
 'slot': 'PROC  1 DIMM  1',
 'vendor': 'HP'}
DEBUG:urllib3.connectionpool:https://netbox:443 "POST /api/dcim/inventory-items/ HTTP/1.1" 400 43
Traceback (most recent call last):
  File "/usr/bin/netbox_agent", line 11, in <module>
    load_entry_point('netbox-agent==0.6.0', 'console_scripts', 'netbox_agent')()
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/cli.py", line 44, in main
    return run(config)
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/cli.py", line 39, in run
    server.netbox_create_or_update(config)
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/server.py", line 272, in netbox_create_or_update
    self.inventory.create_or_update()
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 447, in create_or_update
    self.do_netbox_memories()
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 441, in do_netbox_memories
    self.create_netbox_memory(memory)
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 414, in create_netbox_memory
    description=memory['description'],
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/endpoint.py", line 287, in create
    ).post(args[0] if args else kwargs)
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/query.py", line 381, in post
    return self._make_call(verb="post", data=data)
  File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/query.py", line 274, in _make_call
    raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'part_id': ['This field may not be null.']}
Fix ``` DEBUG:urllib3.connectionpool:https://netbox:443 "GET /api/dcim/manufacturers/?name=HP HTTP/1.1" 200 155 {'description': 'DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)', 'id': 'bank:0', 'product': None, 'serial': 'N/A', 'size': 8.0, 'slot': 'PROC 1 DIMM 1', 'vendor': 'HP'} DEBUG:urllib3.connectionpool:https://netbox:443 "POST /api/dcim/inventory-items/ HTTP/1.1" 400 43 Traceback (most recent call last): File "/usr/bin/netbox_agent", line 11, in <module> load_entry_point('netbox-agent==0.6.0', 'console_scripts', 'netbox_agent')() File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/cli.py", line 44, in main return run(config) File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/cli.py", line 39, in run server.netbox_create_or_update(config) File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/server.py", line 272, in netbox_create_or_update self.inventory.create_or_update() File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 447, in create_or_update self.do_netbox_memories() File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 441, in do_netbox_memories self.create_netbox_memory(memory) File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/netbox_agent/inventory.py", line 414, in create_netbox_memory description=memory['description'], File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/endpoint.py", line 287, in create ).post(args[0] if args else kwargs) File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/query.py", line 381, in post return self._make_call(verb="post", data=data) File "/opt/venvs/netbox-agent/lib/python3.6/site-packages/pynetbox/core/query.py", line 274, in _make_call raise RequestError(req) pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'part_id': ['This field may not be null.']} ```
cyrinux commented 2020-06-08 14:58:53 +02:00 (Migrated from github.com)

Travis seems stuck

Travis seems stuck
cyrinux commented 2020-06-09 08:48:12 +02:00 (Migrated from github.com)

@Solvik @ramnes travis is stuck, i dont know how to wake it up without pushing an useless commit, any idea?

@Solvik @ramnes travis is stuck, i dont know how to wake it up without pushing an useless commit, any idea?
Solvik commented 2020-06-09 09:05:32 +02:00 (Migrated from github.com)

it all passed, but it seems there's a problem with the status reported to github

it all passed, but it seems there's a problem with the status reported to github
Sign in to join this conversation.
No description provided.