Summary
ViperAsset.__init__ at blueflow/models/viper.py:127 raises ValueError(\"How did we end up with an asset that has no model???\") when asset.model is empty. This biases the Viper payload builder to reject any Asset that hasn't had a model populated yet — which is most assets in test fixtures and many in real ingest where the product/model field comes from later enrichment.
Impact
38 test failures in the current suite trace to this single raise (largest bucket by far).
Repro
asset = Asset.objects.create(mac_address=\"AA:BB:CC:DD:EE:FF\") # no model set
ViperAsset(asset) # raises ValueError
Proposed fix
Replace the raise with the empty-string fallback that the cpe property already handles gracefully (CPE will use * for an unknown product slot):
# Before
if not asset.model:
raise ValueError(\"How did we end up with an asset that has no model???\")
raw = str(asset.model)
# After
raw = str(asset.model) if asset.model else \"\"
The downstream cpe property at viper.py:182-183 already maps empty self.product to the CPE * wildcard, so the behavior is consistent.
Notes
Same pattern as the OUI fallback fix that landed earlier today (empty string instead of None/raise as the absent-data sentinel). Internal regression-prevention only — no Viper wire-format change.
Summary
ViperAsset.__init__atblueflow/models/viper.py:127raisesValueError(\"How did we end up with an asset that has no model???\")whenasset.modelis empty. This biases the Viper payload builder to reject any Asset that hasn't had amodelpopulated yet — which is most assets in test fixtures and many in real ingest where the product/model field comes from later enrichment.Impact
38 test failures in the current suite trace to this single raise (largest bucket by far).
Repro
Proposed fix
Replace the raise with the empty-string fallback that the
cpeproperty already handles gracefully (CPE will use*for an unknown product slot):The downstream
cpeproperty atviper.py:182-183already maps emptyself.productto the CPE*wildcard, so the behavior is consistent.Notes
Same pattern as the OUI fallback fix that landed earlier today (empty string instead of None/raise as the absent-data sentinel). Internal regression-prevention only — no Viper wire-format change.