Red Hat Bugzilla – Bug 1382356
[RFE] Delete smart class parameter when a puppet class is deleted
Last modified: 2018-02-21 07:35:52 EST
Description of problem: Our automation has shown that if you import a puppet module that has smart class parameters, you will get one new entry added for the puppet module in the Class page, and 1 or more entries added to the Smart Class Parameters page. If you delete the puppet module, the smart class parameter is not removed and is left 'orphan' in the satellite. The idea is that, if I were to re-import the same module, I may want to re-use the smart class parameters from the previous import. Our automation imports and deletes the same puppet module hundreds of times, so the the satellite ends up accumulating several 'orphan' entries under the smart class parameters page. I'd like to request a mechanism by which one can delete one or more smart class parameters. As a satellite admin user I'd like to be able to perform delete actions through the API, CLI (Hammer) and UI. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Upstream bug assigned to orabin@redhat.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17810 has been resolved.
Please add verifications steps for this bug to help QE verify
Steps to verify: 1. Import any puppet class with parameters 2. Delete the puppet class and import it again 4. Check that there is only one copy of the parameter in Configure -> Smart class parameters Expected result: There should only be one copy of the parameter and it should also be connected to the puppet class
VERIFIED. Though this BZ no longer honor its title: "Need a machanism..." With the fix you just do not need such mechanism. So not an RFE. @satellite-6.2.9-1.0.el7sat.noarch foreman-1.11.0.73-1.el7sat.noarch Used manual reproducer in comment#8 with foreman_scap_client REPRO: # hammer -p changeme sc-param list --puppet-class foreman_scap_client ---|------------------|-----------------------------------------------------|----------|-------------------- ID | PARAMETER | DEFAULT VALUE | OVERRIDE | PUPPET CLASS ---|------------------|-----------------------------------------------------|----------|-------------------- 22 | ca_file | ${$::foreman_scap_client::params::ca_file} | | foreman_scap_client 22 | ca_file | ${$::foreman_scap_client::params::ca_file} | | foreman_scap_client 23 | host_certificate | ${$::foreman_scap_client::params::host_certificate} | | foreman_scap_client 23 | host_certificate | ${$::foreman_scap_client::params::host_certificate} | | foreman_scap_client 24 | host_private_key | ${$::foreman_scap_client::params::host_private_key} | | foreman_scap_client 24 | host_private_key | ${$::foreman_scap_client::params::host_private_key} | | foreman_scap_client 25 | policies | | true | foreman_scap_client 25 | policies | | true | foreman_scap_client 21 | port | | true | foreman_scap_client 21 | port | | true | foreman_scap_client 20 | server | | true | foreman_scap_client 20 | server | | true | foreman_scap_client ---|------------------|-----------------------------------------------------|----------|-------------------- vs. FIX: # hammer -p changeme sc-param list --puppet-class foreman_scap_client ---|------------------|-----------------------------------------------------|----------|-------------------- ID | PARAMETER | DEFAULT VALUE | OVERRIDE | PUPPET CLASS ---|------------------|-----------------------------------------------------|----------|-------------------- 22 | ca_file | ${$::foreman_scap_client::params::ca_file} | | foreman_scap_client 23 | host_certificate | ${$::foreman_scap_client::params::host_certificate} | | foreman_scap_client 24 | host_private_key | ${$::foreman_scap_client::params::host_private_key} | | foreman_scap_client 25 | policies | | true | foreman_scap_client 21 | port | | true | foreman_scap_client 20 | server | | true | foreman_scap_client ---|------------------|-----------------------------------------------------|----------|-------------------- >>> with the fix you get no orphaned sc params any longer (UI/CLI)
Also >>> Upgrades from 6.2.8 (where I reproduced) > 6.2.9 triggered 20161205142618_delete_orphaned_smart_class_parameters.rb and deleted orphaned params.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:1191
Hey guys -- internal merge request 234 that was linked by Zach here rolls back the VERIFIED changes from http://projects.theforeman.org/issues/17810. Essentially, the last change (merge request 234) completely undid this rfe and leaves Satellite 6.2.9 with no way to bulk delete smart parameters. If we could get this addressed and pull 17810 from foreman brought back into Satellite 6.2.9 asap, that would be most appreciated. Cheers, Karl
This RFE has changed and does not allow a bulk delete anymore, see comment 9. The fix for 6.2.9 (https://bugzilla.redhat.com/show_bug.cgi?id=1383386) no longer shows the historical smart class parameters that are not connected to the puppet class anymore. This RFE now deletes the smart class parameters when deleting the puppet class and will be added in 6.3.
I am cleaning up the bugs a bit which I have screwed up. https://bugzilla.redhat.com/show_bug.cgi?id=1383386 is the small fix that should go to 6.2.z https://bugzilla.redhat.com/show_bug.cgi?id=1382356 is the full fix. https://bugzilla.redhat.com/show_bug.cgi?id=1426394 is the clone of the full fix and needs to be closed.
*** Bug 1382677 has been marked as a duplicate of this bug. ***
VERIFIED. @satellite-6.3.0-16.0.beta.el7sat.noarch foreman-1.15.3-2.el7sat.noarch Used manual reproducer in comment#8 with foreman_scap_client 1. Import puppet classes esp. foreman_scap_client # hammer sc-param list --puppet-class foreman_scap_client ---|----------------------|-----------------------------------------------------|----------|-------------------- ID | PARAMETER | DEFAULT VALUE | OVERRIDE | PUPPET CLASS ---|----------------------|-----------------------------------------------------|----------|-------------------- 42 | ca_file | ${$::foreman_scap_client::params::ca_file} | | foreman_scap_client 41 | ensure | present | | foreman_scap_client 48 | foreman_repo_gpg_chk | | | foreman_scap_client 46 | foreman_repo_key | https://yum.theforeman.org/RPM-GPG-KEY-foreman | | foreman_scap_client 45 | foreman_repo_rel | | | foreman_scap_client 47 | foreman_repo_src | | | foreman_scap_client 43 | host_certificate | ${$::foreman_scap_client::params::host_certificate} | | foreman_scap_client 44 | host_private_key | ${$::foreman_scap_client::params::host_private_key} | | foreman_scap_client 40 | policies | | true | foreman_scap_client 39 | port | | true | foreman_scap_client 38 | server | | true | foreman_scap_client ---|----------------------|-----------------------------------------------------|----------|-------------------- 2. Delete foreman_scap_client puppet class 3. Import foreman_scap_client puppet class again 4. Check that there is only one copy of the parameter in Configure -> Smart class parameters: foreman_scap_client # hammer sc-param list --puppet-class foreman_scap_client ---|----------------------|-----------------------------------------------------|----------|-------------------- ID | PARAMETER | DEFAULT VALUE | OVERRIDE | PUPPET CLASS ---|----------------------|-----------------------------------------------------|----------|-------------------- 53 | ca_file | ${$::foreman_scap_client::params::ca_file} | | foreman_scap_client 52 | ensure | present | | foreman_scap_client 59 | foreman_repo_gpg_chk | | | foreman_scap_client 57 | foreman_repo_key | https://yum.theforeman.org/RPM-GPG-KEY-foreman | | foreman_scap_client 56 | foreman_repo_rel | | | foreman_scap_client 58 | foreman_repo_src | | | foreman_scap_client 54 | host_certificate | ${$::foreman_scap_client::params::host_certificate} | | foreman_scap_client 55 | host_private_key | ${$::foreman_scap_client::params::host_private_key} | | foreman_scap_client 51 | policies | | true | foreman_scap_client 50 | port | | true | foreman_scap_client 49 | server | | true | foreman_scap_client ---|----------------------|-----------------------------------------------------|----------|-------------------- >>> parameters were deleted with class deletion as there is no duplicity in respective params and also their ids are different after re-import
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:0336