Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad skipping of assert in production env #17173

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def find(reference, ref: primary_index_ref)
# TODO(lsmola) lazy_find will support only hash, then we can remove the _by variant
# TODO(lsmola) this method should return lazy too, the rest of the finders should be deprecated
return if reference.nil?
return unless assert_index(reference, ref)
assert_index(reference, ref)

reference = inventory_collection.build_reference(reference, ref)

Expand Down Expand Up @@ -103,7 +103,7 @@ def lazy_find(manager_uuid, ref: primary_index_ref, key: nil, default: nil)
# access the data
# TODO(lsmola) lazy_find will support only hash, then we can remove the _by variant
return if manager_uuid.nil?
return unless assert_index(manager_uuid, ref)
assert_index(manager_uuid, ref)

::ManagerRefresh::InventoryObjectLazy.new(inventory_collection,
manager_uuid,
Expand Down Expand Up @@ -203,8 +203,6 @@ def assert_index(manager_uuid, ref)
# Assert the that possible relation is nil or InventoryObject or InventoryObjectlazy class
assert_relation_keys({named_ref(ref).first => manager_uuid}, ref)
end

true
rescue => e
_log.error("Error when asserting index: #{manager_uuid}, with ref: #{ref} of: #{inventory_collection}")
raise e
Expand Down