tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

Intake of asset with missing interface capacity inserts duplicate lshw rows #404

Closed byxorna closed 8 years ago

byxorna commented 8 years ago

When intaking some assets that dont properly report capacity on their interfaces in LSHW, it appears there is a bug in collins that will blindly insert rows for hardware attributes without checking for duplicates. I didnt specify the lshw.defaultNicCapacity, so each LSHW submission was failing with:

Exception Class: class collins.util.parsers.AttributeNotFoundException Exception Message: Could not find capacity for network interface for MYNETWORKINTERFACEHERE Message: Exception updating asset

The interesting bit is when you look at the hardware details page once i fixed submission by setting a default capacity, you can see each nic or harddrive was inserted multiple times (one for each lshw submission failure). screen shot 2016-01-27 at 4 58 37 pm screen shot 2016-01-27 at 5 01 52 pm

If we can wrap the LSHW insertion in a transaction, that would be simplest.

byxorna commented 8 years ago

Actually, this is my bad. There are other factors at play here; closing :)