Bug #17252

Unable to set empty parameter via hammer

Added by Tomáš Strachota about 1 year ago. Updated 1 day ago.

Status:Ready For Testing
Priority:Normal
Assigned To:Martin Bacovsky
Category:Hammer core
Target version:Foreman - Team Ivan - Iteration 23
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/hammer-cli/pull/260
Story points-
Velocity based estimate-

Description

Hammer doesn't allow to to send nil values, which prevents users from re-setting attributes to their default values in some cases. The only thing a user can do is to send empty string --param="" but it's not the same as nil.

From the discussions about this topic it seems that one of the solutions could be to use a reserved value, that would be translated to nil internally. Users could override the value using some env variable.
For example:

hammer domain update --name test --dns nil
HAMMER_NIL=None hammer domain update --name test --dns None


Related issues

Related to Hammer CLI - Bug #13994: Cannot dis-associate a Subnet from a Domain using Hammer New 03/01/2016
Related to Hammer CLI - Bug #17250: Unable to remove all locations or organizations from a do... New 11/07/2016
Related to Hammer CLI - Tracker #2823: Tracker for usability issues New 07/24/2013

History

#1 Updated by Tomáš Strachota about 1 year ago

  • Related to Bug #13994: Cannot dis-associate a Subnet from a Domain using Hammer added

#2 Updated by Tomáš Strachota about 1 year ago

  • Related to Bug #17250: Unable to remove all locations or organizations from a domain added

#3 Updated by Tomáš Strachota about 1 year ago

#4 Updated by Martin Bacovsky 3 days ago

  • Target version changed from Team Marek backlog to Team Ivan - Iteration 23
  • Assigned To set to Martin Bacovsky
  • Status changed from New to Assigned

#5 Updated by The Foreman Bot 2 days ago

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

Also available in: Atom PDF