Bug 1342774

Summary: updating smart class parameter using name fails due to finding more that one parameters
Product: Red Hat Satellite Reporter: Rishi <rjain>
Component: APIAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED ERRATA QA Contact: Tomas Strachota <tstrachota>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: alexander.schneider, bbuckingham, bkearney, cwelton, egolov, ess-unisys, jalviso, mkalyat, orabin, pierre-yves.goubet, pmutha, rbobek, smeyer, tstrachota, xdmoon
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rishi 2016-06-05 05:57:30 UTC
Description of problem:

Multiple duplicate parameters exist due to multiple environments

# hammer sc-param list
----|--------------------------------|----------------------------------------------------------------------------------|----------|-------------
ID  | PARAMETER                      | DEFAULT VALUE                                                                    | OVERRIDE | PUPPET CLASS
----|--------------------------------|----------------------------------------------------------------------------------|----------|-------------
49  | accept_env                     | LANG LC_*                                                                        |          |             
49  | accept_env                     | LANG LC_*                                                                        |          |             
49  | accept_env                     | LANG LC_*                                                                        |          |             
49  | accept_env                     | LANG LC_*                                                                        |          |             
3   | additional_shells              | []                                                                               |          |             
3   | additional_shells              | []                                                                               |          |             
3   | additional_shells              | []                                                                               |          |             
3   | additional_shells              | []                                                                               |          |             
30  | allowed_groups                 | []                                                                               |          |             
30  | allowed_groups                 | []                                                                               |          |             


# hammer sc-param update --puppet-class ssh::server --name accept_env --override true --default-value "LANG LC_* LANGUAGE XMODIFIERS"
Could not update the parameter:
  Error: found more than one smart_class_parameter


Using ID instead of name work.


# hammer sc-param update --id 49 --override true --default-value "LANG LC_* LANGUAGE XMODIFIERS"
Parameter updated

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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Bryan Kearney 2016-07-26 15:25:24 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 3 Bryan Kearney 2016-07-26 15:28:08 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 8 jalviso 2016-10-22 00:46:28 UTC
Hi,

The issue reported in this bug still exists with satellite 6.2.2 async version.

Regards,

Josephine Alviso
GSS - APAC

Comment 10 Bryan Kearney 2016-10-26 14:16:33 UTC
Upstream bug assigned to mbacovsk

Comment 11 Bryan Kearney 2016-10-26 14:16:38 UTC
Upstream bug component is API

Comment 12 Bryan Kearney 2016-10-26 14:16:42 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15833 has been resolved.

Comment 16 Tomas Strachota 2017-08-02 13:15:57 UTC
Verified.

Version Tested: Satellite-6.3 Snap 8

I was able to get info about a smart class parameter and update it when the puppet module was installed in two environemnts.


Full verification steps:

> puppet module install puppetlabs-motd --environment development
Notice: Preparing to install into /etc/puppet/environments/development/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/environments/development/modules
└─┬ puppetlabs-motd (v1.4.0)
  └─┬ puppetlabs-registry (v1.1.4)
    └── puppetlabs-stdlib (v4.17.1)

> puppet module install puppetlabs-motd --environment production
Notice: Preparing to install into /etc/puppet/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/environments/production/modules
└─┬ puppetlabs-motd (v1.4.0)
  └─┬ puppetlabs-registry (v1.1.4)
    └── puppetlabs-stdlib (v4.17.1)


> hammer puppet-class info --name motd
Id:                     1
Name:                   motd
Smart variables:        

Smart class parameters: 
    content
    dynamic_motd
    template
Hostgroups:             

Environments:           
    development
    production
Parameters:


> hammer sc-param list --puppet-class motd
---|--------------|---------------|----------|-------------
ID | PARAMETER    | DEFAULT VALUE | OVERRIDE | PUPPET CLASS
---|--------------|---------------|----------|-------------
3  | content      |               |          | motd        
1  | dynamic_motd | true          |          | motd        
2  | template     |               |          | motd        
---|--------------|---------------|----------|-------------

> hammer sc-param info --puppet-class motd --name template
Id:                 2
Parameter:          template
Default Value:      
Override:           false
Puppet class:       motd
Description:        
Type:               string
Hidden Value?:      false
Use puppet default: no
Required:           false
Validator:          
    Type: 
    Rule:
Override values:    
    Merge overrides:     no
    Merge default value: no
    Avoid duplicates:    no
    Order:               
      fqdn
      hostgroup
      os
      domain
    Values:
Environments:       
    development
    production
Created at:         2017/08/02 13:00:27
Updated at:         2017/08/02 13:00:27

> hammer sc-param update --puppet-class motd --name template  --override true --default-value Hello!
Parameter updated

> hammer sc-param info --puppet-class motd --name template
Id:                 2
Parameter:          template
Default Value:      Hello!
Override:           true
Puppet class:       motd
Description:        
Type:               string
Hidden Value?:      false
Use puppet default: no
Required:           false
Validator:          
    Type: 
    Rule:
Override values:    
    Merge overrides:     no
    Merge default value: no
    Avoid duplicates:    no
    Order:               
      fqdn
      hostgroup
      os
      domain
    Values:
Environments:       
    development
    production
Created at:         2017/08/02 13:00:27
Updated at:         2017/08/02 13:08:28

Comment 17 Satellite Program 2018-02-21 16:54:37 UTC
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