Bug #18226

Unable to delete Default Location from katello

Added by Daniel Lobato Garcia 11 months ago. Updated 10 months ago.

Status:Closed
Priority:Normal
Assigned To:Daniel Lobato Garcia
Category:-
Target version:Foreman - Team Daniel - Iteration 9
Difficulty: Pull request:https://github.com/Katello/katello/pull/6568
Bugzilla link:1268012
Story points-
Velocity based estimate-
ReleaseKatello 3.4.0Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1268012
Description of problem:
It is impossible to delete an unused "Default Location" from Satellite 6.1 either through webUI or hammer CLI

Version-Release number of selected component (if applicable):

How reproducible:
100%

Steps to Reproduce:
1. Install fresh Satellite 6.1 without specifying --foreman-initial-location and --foreman-initial-organization parameters, which would create a Default Organization and Default Location
2. Create a new Organization and Location of choice in Satellite webUI
3. Try to delete the old "Default Location" which fails with error "Cannot delete the default Location"

Same result from the hammer CLI as well
hammer> location list
[Foreman] Username: admin
[Foreman] Password for admin:
---|-----------------
ID | NAME
---|-----------------
2 | Default Location
4 | ACME_Corp
---|-----------------
hammer> location delete --id 2
Could not delete the location:
Cannot delete the default Location

Actual results:
Cannot delete the default location

Expected results:
Satellite should allow delete unused locations

Additional info:

  1. foreman-rake console
    Loading production environment (Rails 3.2.8)
    irb(main):001:0> Location.all
    2015-10-01 20:15:03 [D] Location Load (0.7ms) SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."type" IN ('Location') ORDER BY title
    => [#<Location id: 2, name: "Default Location", type: "Location", created_at: "2015-08-31 15:13:09", updated_at: "2015-08-31 15:13:09", ignore_types: ["ConfigTemplate", "Hostgroup"], description: nil, label: nil, apply_info_task_id: nil, ancestry: nil, title: "Default Location", katello_default: true>, #<Location id: 4, name: "ACME_Corp", type: "Location", created_at: "2015-09-02 12:13:08", updated_at: "2015-09-21 16:25:28", ignore_types: ["ConfigTemplate", "Hostgroup"], description: "", label: nil, apply_info_task_id: nil, ancestry: nil, title: "ACME_Corp", katello_default: false>]

As from the above rake output if the "katello_default: true" parameter is set for the location, Satellite 6 would not allow to delete it.


Related issues

Related to Katello - Bug #21071: Seeding on git based setups broken Closed 09/22/2017

Associated revisions

Revision c3a0892d
Added by Daniel Lobato Garcia 10 months ago

Fixes #18226 - Allow default Location to be removed

The default location provided a location for new Puppet content
publishes and for new hosts coming through subscription manager. This PR
adds a setting for these two things, which would allow an user to change
the location they want for each of these things separately. It still
protects that the setting must always have a value

History

#1 Updated by The Foreman Bot 11 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Daniel Lobato Garcia
  • Pull request https://github.com/Katello/katello/pull/6568 added

#2 Updated by Justin Sherrill 11 months ago

  • Release set to Katello Backlog

#3 Updated by The Foreman Bot 11 months ago

  • Release deleted (Katello Backlog)

#4 Updated by Justin Sherrill 10 months ago

  • Subject changed from Unable to delete Default Location from Satellite 6.1 to Unable to delete Default Location from katello
  • Release set to Katello Backlog

#5 Updated by The Foreman Bot 10 months ago

  • Release deleted (Katello Backlog)

#6 Updated by Anonymous 10 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Eric Helms 10 months ago

  • Release set to Katello 3.4.0

#8 Updated by Daniel Lobato Garcia 10 months ago

  • Target version set to Team Daniel - Iteration 9

#9 Updated by Marek Hulán 3 months ago

  • Related to Bug #21071: Seeding on git based setups broken added

Also available in: Atom PDF