Bug #17252

Unable to set empty parameter via hammer

Added by Tomáš Strachota 6 months ago.

Status:New
Priority:Normal
Assigned To:-
Category:Hammer core
Target version:Foreman - Team Marek backlog
Difficulty: Bugzilla link:
Found in release: Pull request:
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 general usability complains New 07/24/2013

History

#1 Updated by Tomáš Strachota 6 months ago

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

#2 Updated by Tomáš Strachota 6 months ago

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

#3 Updated by Tomáš Strachota 6 months ago

  • Related to Tracker #2823: Tracker for general usability complains added

Also available in: Atom PDF