Bug #867

updating a host to belong to a null hostgroup doesn't work

Added by Corey Osman over 9 years ago. Updated over 9 years ago.

Web Interface
Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


when I call http://foreman/hosts/update_multiple_hostgroup with some json code where the hostgroup_id is set to "". The api call completes but it doesn't seem to update the host.
If I were to update the host through http://foreman/hosts/FQDN and pass in hostgroup_id="" the command would complete successfully and set the hostgroup to "blank" hostgroup. I also don't see a method to select a "blank" hostgroup when using the webui multiedit function either. I'll need this feature in order to unset a host from a hostgroup from my mobile app

Related issues

Related to Foreman - Bug #892: submit button is missing when host has no hostgroup and is managedClosed2011-05-09

Associated revisions

Revision bf228dd6 (diff)
Added by Paul Kelly over 9 years ago

Fixes 867 - Allow update_multiple to clear hostgroup

Also added the facility for clearing the environment to update_multiple_environments

Signed-off-by: Paul Kelly <>


#1 Updated by Ohad Levy over 9 years ago

  • Project changed from Smart Proxy to Foreman

#2 Updated by Corey Osman over 9 years ago

  • Target version set to 0.3

#3 Updated by Paul Kelly over 9 years ago

  • Category set to Web Interface
  • Status changed from New to Ready For Testing
  • Assignee set to Paul Kelly

A hostgroup id of "clear", rather than the numeric value of a hostgroup_id, is now interpreted as a request to replace the current hostgroup_id for all multiple hosts with a nil.
I have not explicitly tested the API with a json call as I am not clear as to how this differs from the web interface interaction. Are there tools to help with the testing of this?

#4 Updated by Corey Osman over 9 years ago

I'll take a look at it and test it out.

#5 Updated by Corey Osman over 9 years ago

Just tested and it works very well. I wasn't able to test the environment portion but I am now able to set the hostgroup to "".

#6 Updated by Paul Kelly over 9 years ago

  • % Done changed from 0 to 100

#7 Updated by Ohad Levy over 9 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF