Bug 1310568 - Remove '--new-name' option from sc-param to not to update the param name.
Remove '--new-name' option from sc-param to not to update the param name.
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: --
Assigned To: Tomas Strachota
aruzicka
http://projects.theforeman.org/issues...
:
Depends On:
Blocks: 1278718
  Show dependency treegraph
 
Reported: 2016-02-22 04:16 EST by Jitendra Yejare
Modified: 2016-07-27 07:07 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 07:07:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 13830 None None None 2016-04-22 11:10 EDT

  None (edit)
Description Jitendra Yejare 2016-02-22 04:16:26 EST
Description of problem:
Currently '--new-name' option is shown to update the smart class parameter name from CLI. But actually smart class parameter name should not be updated by any means. This option is applicable in case of 'smart variable' only.

Version-Release number of selected component (if applicable):
foreman-1.11.0-0.develop.201602171602gitd5b5059.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Attempt to update the smart class parameter name using CLI hammer commnad:
# hammer sc-param update --new-name <new_anme> --id <sc-params id>

Actual results:
Success !

Example Output:
[root@qeblade36 ~]# hammer sc-param update --help
Ignoring ruby-libvirt-0.5.2 because its extensions are not built.  Try: gem pristine ruby-libvirt --version 0.5.2
Usage:
    hammer sc-param update [OPTIONS]

Options:
 --avoid-duplicates AVOID_DUPLICATES         Remove duplicate values (only array type)
                                             One of true/false, yes/no, 1/0.
 --default-value DEFAULT_VALUE               Value to use when there is no match
 --description DESCRIPTION                   Description of smart class
 --hidden-value HIDDEN_VALUE                 When enabled the parameter is hidden in the UI
                                             One of true/false, yes/no, 1/0.
 --id ID                                      
 --merge-default MERGE_DEFAULT               Include default value when merging all matching values
                                             One of true/false, yes/no, 1/0.
 --merge-overrides MERGE_OVERRIDES           Merge all matching values (only array/hash type)
                                             One of true/false, yes/no, 1/0.
 --name NAME                                 Smart class parameter name
 --new-name NEW_NAME                          
 --override OVERRIDE                         Override this parameter.
                                             One of true/false, yes/no, 1/0.
 --override-value-order OVERRIDE_VALUE_ORDER The order in which values are resolved
 --parameter-type PARAMETER_TYPE             Type of the parameter.
                                             Possible value(s): 'string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'
 --path PATH                                 The order in which values are resolved
 --puppet-class PUPPET_CLASS_NAME            Puppet class name
 --puppet-class-id PUPPET_CLASS_ID           ID of Puppet class
 --required REQUIRED                         This parameter is required.
                                             One of true/false, yes/no, 1/0.
 --use-puppet-default USE_PUPPET_DEFAULT     Do not send this parameter via the ENC. Puppet will use the value defined
                                             in the Puppet manifest for this parameter
                                             One of true/false, yes/no, 1/0.
 --validator-rule VALIDATOR_RULE             Used to enforce certain values for the parameter values
 --validator-type VALIDATOR_TYPE             Type of the validator.
                                             Possible value(s): 'regexp', 'list', ''
 -h, --help                                  print help


Expected results:
The '--new-name' option should not be available for sc-param.
Comment 3 Bryan Kearney 2016-02-22 10:04:37 EST
Upstream bug assigned to tstrachota@redhat.com
Comment 4 Bryan Kearney 2016-02-22 10:04:39 EST
Upstream bug assigned to tstrachota@redhat.com
Comment 5 Bryan Kearney 2016-02-25 06:04:14 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/13830 has been closed
-------------
Anonymous
Applied in changeset commit:hammer-cli-foreman|90ec64540dbf3e4546d3cd33492ef8c1279517e1.
Comment 7 Jitendra Yejare 2016-03-14 05:52:21 EDT
Verified in this latest Satellite 6.2 snap 3.

The issue is still persists. I can see '--new-name' option for sc-param to update.
Also on attempt to update sc-param with --new-name, output says 'parameter updated'.
Comment 8 Tomas Strachota 2016-03-15 05:43:10 EDT
For some reason the bug made it to ON_QA without cherry-pick. Switching back to POST with a note in the devel whiteboard.
Comment 9 Eric Helms 2016-03-15 13:28:08 EDT
Please don't include needs_cherrypick manually as that is set and used by our tooling.
Comment 11 aruzicka 2016-05-26 09:09:49 EDT
VERIFIED.

@Sat6.2.0-Snap13.1
tfm-rubygem-hammer_cli_katello-0.0.22.11-1.el7sat.noarch

used reproducer in comment #0:

# hammer sc-param update --help
Usage:
    hammer sc-param update [OPTIONS]

Options:
 --avoid-duplicates AVOID_DUPLICATES         Remove duplicate values (only array type)
                                             One of true/false, yes/no, 1/0.
 --default-value DEFAULT_VALUE               Value to use when there is no match
 --description DESCRIPTION                   Description of smart class
 --hidden-value HIDDEN_VALUE                 When enabled the parameter is hidden in the UI
                                             One of true/false, yes/no, 1/0.
 --id ID                                      
 --merge-default MERGE_DEFAULT               Include default value when merging all matching values
                                             One of true/false, yes/no, 1/0.
 --merge-overrides MERGE_OVERRIDES           Merge all matching values (only array/hash type)
                                             One of true/false, yes/no, 1/0.
 --name NAME                                 Smart class parameter name
 --override OVERRIDE                         Override this parameter.
                                             One of true/false, yes/no, 1/0.
 --override-value-order OVERRIDE_VALUE_ORDER The order in which values are resolved
 --parameter-type PARAMETER_TYPE             Type of the parameter.
                                             Possible value(s): 'string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'
 --path PATH                                 The order in which values are resolved
 --puppet-class PUPPET_CLASS_NAME            Puppet class name
 --puppet-class-id PUPPET_CLASS_ID           ID of Puppet class
 --required REQUIRED                         This parameter is required.
                                             One of true/false, yes/no, 1/0.
 --use-puppet-default USE_PUPPET_DEFAULT     Do not send this parameter via the ENC. Puppet will use the value defined
                                             in the Puppet manifest for this parameter
                                             One of true/false, yes/no, 1/0.
 --validator-rule VALIDATOR_RULE             Used to enforce certain values for the parameter values
 --validator-type VALIDATOR_TYPE             Type of the validator.
                                             Possible value(s): 'regexp', 'list', ''
 -h, --help                                  print help

# hammer sc-param list | head -n 4
---|--------------------|---------------|----------|-----------------------
ID | PARAMETER          | DEFAULT VALUE | OVERRIDE | PUPPET CLASS          
---|--------------------|---------------|----------|-----------------------
6  | authmethod         |               |          | access_insights_client

# hammer sc-param update --id 6 --new-name newname
Could not update the parameter:
  Error: Unrecognised option '--new-name'
  
  See: 'hammer sc-param update --help'

>>> the '--new-name' option is not shown in --help
>>> the '--new-name' option is not accepted
Comment 12 Bryan Kearney 2016-07-27 07:07:01 EDT
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-2016:1501

Note You need to log in before you can comment on or make changes to this bug.