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

Generic banned asset tags are not accounting for word case #31

Closed
phbureau opened this issue Jan 14, 2020 · 3 comments
Closed

Generic banned asset tags are not accounting for word case #31

phbureau opened this issue Jan 14, 2020 · 3 comments

Comments

@phbureau
Copy link

Hello,
First of all thanks for this wonderful plugin ;!

I have tried to import two esxi devices (cisco b200m5).
It works fine for the first one but not for the second one.
I saw that the first has an "asset tag" which is "UNKNOWN". -->>

And here is the error :

[WARNING] NetBox failed to create devices object. A duplicate record may exist or the data sent is not acceptable.
2020-01-14 11:00:27,294 [DEBUG] NetBox 400 status reason: {'asset_tag': ['device with this Asset tag already exists.']}
2020-01-14 11:00:27,294 [DEBUG] Unaccepted request data: {'name': 'esx002', 'device_type': {'model': 'UCSB-B200-M5'}, 'device_role': {'name': 'Server'}, 'platform': {'name': 'VMware ESXi'}, 'site': {'name': 'vCenter'}, 'serial': 'xxxx', 'asset_tag': 'UNKNOWN', 'cluster': {'name': 'xxxx}, 'status': 1, 'tags': ['Synced', 'vCenter', 'xxxx']}

So I understood that these two machines got the same asset tag (UNKNOWN) which is not acceptable.

Have you got an idea on how I could set another asset tag ?

Thanks for you replies :)

@synackray
Copy link
Owner

Hi @phbureau! Thanks for the report. You're spot on that the asset tags must be unique. I have a an existing banned asset tag word list to match against for situations like these. Let me make a few adjustments and I'll have an update for you shortly.

@synackray
Copy link
Owner

I've updated the banned asset tag check to account for case. Unknown is already disallowed and now it should catch. I'm going to place this in the develop branch for now, run it through full testing, and then I'll promote it into master seeing as this is a very minor adjustment.

@synackray synackray added this to the v1.1.0 Release milestone Jan 14, 2020
synackray added a commit that referenced this issue Jan 14, 2020
Adjusted banned asset tag check to handle case differences for #31
@synackray synackray changed the title Cannot add two esxi devices simultaneously Generic banned asset tags are not accounting for word case Jan 14, 2020
@phbureau
Copy link
Author

I retried with your develop branch, it is working very well, no more errors !
Thank you very much for your reactivity !

synackray added a commit that referenced this issue Jan 15, 2020
Enhance banned asset tags for #31 and fix virtual interface prune eligibility for #35
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