Skip to content
This repository was archived by the owner on Jan 8, 2021. It is now read-only.

Improve handling of serial numbers and asset tags #58

Closed
Razmuzh opened this issue Feb 7, 2020 · 3 comments
Closed

Improve handling of serial numbers and asset tags #58

Razmuzh opened this issue Feb 7, 2020 · 3 comments

Comments

@Razmuzh
Copy link

Razmuzh commented Feb 7, 2020

2020-02-07 08:48:05,796 [DEBUG] Received HTTP Status 400.
2020-02-07 08:48:05,797 [WARNING] NetBox failed to create devices object. A duplicate record may exist or the data sent is not acceptable.
2020-02-07 08:48:05,797 [DEBUG] NetBox 400 status reason: {"serial":["This field may not be null."]}
2020-02-07 08:48:05,798 [DEBUG] Unaccepted request data: {'name': 'esxvmware205', 'device_type': {'model': 'PowerEdge R810'}, 'device_role': {'name': 'Server'}, 'platform': {'name': 'VMware ESXi'}, 'site': {'name': 'vCenter'}, 'serial': None, 'asset_tag': None, 'cluster': {'name': 'CL01-GF-DEV'}, 'status': 'active', 'tags': ['Synced', 'vCenter', 'p-114-288-001']}

@Razmuzh
Copy link
Author

Razmuzh commented Feb 7, 2020

Got around it by editing line 443 in run.py to:
serial_number = "00000000"

@synackray
Copy link
Owner

Thanks for the report @Razmuzh! I will apply a permanent fix to this for the upcoming release.

@synackray synackray added this to the v1.1.0 Release milestone Feb 7, 2020
@synackray synackray changed the title Error adding Hosts Improve handling of serial numbers and asset tags Feb 8, 2020
synackray added a commit that referenced this issue Feb 9, 2020
@synackray
Copy link
Owner

Corrected with the use of netbox object templates. Non-required fields with None values will not be passed to NetBox to avoid this in the future.

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

No branches or pull requests

2 participants