That seems to indicate, we’re trying to save the same OS for the second time. Could you please point us to the test definition, that’s failing? I looked at the puppet fact parser code and it seems the problem is something else.
This is what happens in the console after I created the OS once already
2022-01-28T14:35:06 [D|sql|] Operatingsystem Load (0.7ms) SELECT "operatingsystems".* FROM "operatingsystems" WHERE "operatingsystems"."id" = $1 ORDER BY "operatingsystems"."title" ASC LIMIT $2 [["id", 15], ["LIMIT", 1]]
=> #<Redhat:0x000055d5ff28c0a0
id: 15,
major: "8",
name: "CentOS_Stream",
minor: "",
nameindicator: nil,
created_at: Fri, 28 Jan 2022 13:34:11 UTC +00:00,
updated_at: Fri, 28 Jan 2022 13:34:11 UTC +00:00,
release_name: nil,
type: "Redhat",
description: nil,
password_hash: [FILTERED],
title: "CentOS_Stream 8">
[12] pry(main)> Operatingsystem.find_or_initialize_by :name => 'CentOS_Stream', :major => 8, :minor => nil
2022-01-28T14:35:12 [D|sql|] Operatingsystem Load (1.1ms) SELECT "operatingsystems".* FROM "operatingsystems" WHERE "operatingsystems"."name" = $1 AND "operatingsystems"."major" = $2 AND "operatingsystems"."minor" IS NULL ORDER BY "operatingsystems"."title" ASC LIMIT $3 [["name", "CentOS_Stream"], ["major", "8"], ["LIMIT", 1]]
=> #<Operatingsystem:0x000055d5ff2f0d70
id: nil,
major: "8",
name: "CentOS_Stream",
minor: nil,
nameindicator: nil,
created_at: nil,
updated_at: nil,
release_name: nil,
type: nil,
description: nil,
password_hash: [FILTERED],
title: nil>
why that happens? The minor of the OS is “” instead of nil. IMHO it’s not necessarily caused by the linked patch, it’s just the first OS with empty minor. We need to drop the :minor => nil
for such OSes or we need to make sure the minor is always NULL in the DB.