Bug #17135

Creating override-value-order for smart classes using CLI doesnt handle comma delimited order

Added by Ori Rabin 10 months ago. Updated 28 days ago.

Status:Closed
Priority:Normal
Assigned To:Ori Rabin
Category:Smart variables
Target version:Foreman - Team Ivan Iteration 17
Difficulty: Bugzilla link:1328613
Found in release: Pull request:https://github.com/theforeman/hammer-cli/pull/246, https://github.com/theforeman/hammer-cli-foreman/pull/312
Story points-
Velocity based estimate-
Releasehammer-cli-0.11.0Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1328613

Description of problem:

When setting an override-value-order for an sc-param hammer is not
correctly parsing the comma delimited order, rather taking that
comma delimited list as a single argument.

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

Sat 6.1.7

How reproducible:

100%

Steps to Reproduce:
1. hammer -u admin -p password sc-param update --override true --default-value ["10.37.224.254"] --id 129 --parameter-type array --override-value-order fqdn','datacentre','region','lifecycle_environment','hostgroup','datacentre,lifecycle_environment'
2.
3.

Actual results:

It's creating a single order value
‘fqdn','datacentre','region','lifecycle_environment','hostgroup','datacentre,lifecycle_environment'

Expected results:

It should create an ordered list, ie.
fqdn
datacentre
region
lifecycle_environment
hostgroup
datacentre,lifecycle_environment

Additional info:


Related issues

Related to Hammer CLI - Bug #17355: Indistinguishable multiple matchers for override value order Closed 11/16/2016
Blocked by Hammer CLI - Bug #17180: Parameters of type list can not include values containing... Closed 11/02/2016

Associated revisions

Revision b1cf7962
Added by Martin Bacovsky about 1 month ago

Refs #17135 - Replace CSV parser in List Normalizer

Revision 78dd9cce
Added by Ori Rabin 28 days ago

Fixes #17135 - Adding a list normalizer to override-value-order

History

#1 Updated by Martin Bacovsky 10 months ago

  • Blocked by Bug #17180: Parameters of type list can not include values containing commas added

#2 Updated by Martin Bacovsky 10 months ago

I'd suggest to use List normalizer for the override-value-order parameter. It can be achieved by using Array type for override-value-order in https://github.com/theforeman/foreman/blob/698e916ce208b5040b83a908a058c83c94d158ee/app/controllers/api/v2/smart_class_parameters_controller.rb#L49

The normalizer needs to be fixed to support commas in the values (#17180) though. The related blocking issue was attached.

#3 Updated by Tomáš Strachota 10 months ago

  • Category changed from Other commands to Smart variables

#4 Updated by Tomáš Strachota 9 months ago

  • Subject changed from Creating override-value-order for smart classes using CLI doesnt handle comma delimited order to Indistinguishable multiple matchers for override value order
  • Status changed from New to Assigned
  • Assigned To set to Tomáš Strachota
  • Target version set to Team Marek Iteration 6

#5 Updated by Tomáš Strachota 9 months ago

  • Subject changed from Indistinguishable multiple matchers for override value order to Creating override-value-order for smart classes using CLI doesnt handle comma delimited order
  • Status changed from Assigned to New
  • Assigned To deleted (Tomáš Strachota)
  • Target version deleted (Team Marek Iteration 6)

#6 Updated by Tomáš Strachota 9 months ago

Disregard my previous two changes and comments. I edited existing issue instead of creating a new one by mistake. I'm sorry.

#7 Updated by Tomáš Strachota 9 months ago

  • Related to Bug #17355: Indistinguishable multiple matchers for override value order added

#8 Updated by Ori Rabin 9 months ago

  • Target version set to Team Ivan backlog

#9 Updated by Ori Rabin 3 months ago

  • Status changed from New to Assigned
  • Assigned To set to Ori Rabin
  • Target version changed from Team Ivan backlog to Team Ivan Iteration 15

#10 Updated by The Foreman Bot 2 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/312 added

#11 Updated by The Foreman Bot 2 months ago

  • Pull request https://github.com/theforeman/hammer-cli/pull/246 added

#12 Updated by Ivan Necas about 1 month ago

  • Target version changed from Team Ivan Iteration 15 to Team Ivan Iteration 17

#13 Updated by Tomáš Strachota about 1 month ago

  • Release set to hammer-cli-0.11.0

#14 Updated by Ori Rabin 28 days ago

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

Also available in: Atom PDF