Bug #7743

Duplicate OSes can be created
Description
As some people in the IRC channel stumbeled upon this, here an issue.
Let's say, there's an OS "Debian 7.6" with all the fields correctly set. I still can create an OS with another name and the same parameters. Some People do this in order to create several variants of e.g. CentOS 6.5 with different provision templates each and run into problems then.
Related issues
Associated revisions
fixes #7743 - ensure name is unique in scope of major and minor
(cherry picked from commit 59b230959ab24b3573eb87616805bf3218a2cb13)
History
#1
Updated by Dominic Cleal almost 8 years ago
- Category set to Host creation
#2
Updated by Joseph Magen almost 8 years ago
There was a recent commit 8b737c9c7648b3726dadb3b2e4708fcb43af02a8 that fixed this.
It was unfortunately hidden within a commit called 'fixes #4386 - gem friendly_id to simplify find by id, name, label, etc'
The was a db migration that added a field called 'title' that must be unique.
Please verify that this is fixed and I (or you) can close this issue.
#3
Updated by Dominic Cleal almost 8 years ago
- Status changed from New to Feedback
#4
Updated by Anonymous almost 8 years ago
That seems to be something different then... Let's say I have this OS for Debian wheezy:
>> Operatingsystem.find_by_id(13) Operatingsystem Load (0.7ms) SELECT "operatingsystems".* FROM "operatingsystems" WHERE "operatingsystems"."id" = 13 ORDER BY operatingsystems.name LIMIT 1 +----+-------+--------+-------+--------------+--------------+----------------+--------------+--------+-------------+-------------+--------------+--------------+------------+ | id | major | name | minor | nameindic... | created_at | updated_at | release_name | type | description | hosts_count | hostgroup... | password_... | title | +----+-------+--------+-------+--------------+--------------+----------------+--------------+--------+-------------+-------------+--------------+--------------+------------+ | 13 | 7 | Debian | 6 | | 2014-07-1... | 2014-09-30 ... | wheezy | Debian | Debian 7.6 | 4 | 0 | MD5 | Debian 7.6 | +----+-------+--------+-------+--------------+--------------+----------------+--------------+--------+-------------+-------------+--------------+--------------+------------+ 1 row in set
I can still create another OS:
+----+-------+--------+-------+--------------+-------------+---------------+--------------+--------+-------------+-------------+--------------+--------------+--------------+ | id | major | name | minor | nameindic... | created_at | updated_at | release_name | type | description | hosts_count | hostgroup... | password_... | title | +----+-------+--------+-------+--------------+-------------+---------------+--------------+--------+-------------+-------------+--------------+--------------+--------------+ | 17 | 7 | Debian | 6 | | 2014-10-... | 2014-10-01... | wheezy | Debian | Deb what... | 0 | 0 | MD5 | Deb whatever | +----+-------+--------+-------+--------------+-------------+---------------+--------------+--------+-------------+-------------+--------------+--------------+--------------+
It's also Debian 7.6 (wheezy).
A guy on IRC had created multiple CentOS 6.5 versions, each with a different name and different Kickstart templates associated. But when the first facts uploads came in, things started to switch around.
#5
Updated by Dominic Cleal almost 8 years ago
- Status changed from Feedback to New
#6
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1885 added
- Pull request deleted (
)
#7
Updated by Shlomi Zadok over 7 years ago
- Assignee set to Shlomi Zadok
#8
Updated by Dominic Cleal over 7 years ago
- Has duplicate Bug #6886: User should not be allowed to create OS with same name and version added
#9
Updated by Dominic Cleal over 7 years ago
- Bugzilla link set to 1120985
#10
Updated by Shlomi Zadok about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 59b230959ab24b3573eb87616805bf3218a2cb13.
#11
Updated by Dominic Cleal about 7 years ago
- Legacy Backlogs Release (now unused) set to 50
#12
Updated by Dominic Cleal over 6 years ago
- Related to Bug #12076: Unable to create Mulitple OS with same name, major, minor added
fixes #7743 - ensure name is unique in scope of major and minor