Bug #22718

Hammer does not error when not all items in list of ids are resolved

Added by Martin Bacovsky about 1 month ago. Updated about 1 month ago.

Status:Closed
Priority:High
Assigned To:Martin Bacovsky
Category:Foreman commands
Target version:Team Ivan - Iteration 28
Difficulty: Bugzilla link:
Found in release:nightly Pull request:https://github.com/theforeman/hammer-cli-foreman/pull/356
Story points-
Velocity based estimate-
Releasehammer-cli-foreman-0.12.1Release relationshipAuto

Description


hammer role create --name a
hammer user-group create --name ug1 --admin true --roles 'a,m'
User group [ug1] created.

But after checking the logs that only role with id = 1 was added.

This is caused by how resolver is counting expected records.
It tries to guess if it is looking up records for resource in singular or plural from the options.
When both (e.g. --name and --names) are present it will pick singular and thus expects just one record.
In the example above the scoped options contain both name = ug1 and names = 'a,m' and the logic fails.

Associated revisions

Revision b05b5418
Added by Martin Bacovsky about 1 month ago

Fixes #22718 - raise error when wrong number of ids is resolved

History

#1 Updated by Martin Bacovsky about 1 month ago

  • Target version changed from Team Ivan - Iteration 27 to Team Ivan - Iteration 28

#2 Updated by The Foreman Bot about 1 month ago

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

#3 Updated by Martin Bacovsky about 1 month ago

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

#4 Updated by Martin Bacovsky about 1 month ago

  • Release set to hammer-cli-foreman-0.12.1

Also available in: Atom PDF