Project

General

Profile

Actions

Bug #1370

closed

creating a machine always sets "owner = user"

Added by Jan van Eldik about 13 years ago. Updated almost 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When creating a machine through the API, it seems the ownership is always
set to user issues the request, even though owner_id does not correspond
to this user.

In other words, when I use my "jveldik" account to register a new
machine in Foreman, and I specify "owner_id = 1" to set ownership to
the "admin" account, Foreman sets it to "jveldik" (owner_id = 6).

From the Foreman log file:

Processing HostsController#create (for 128.141.28.9 at 2011-12-05 16:40:46) [POST]
Parameters: {"action"=>"create", "controller"=>"hosts", "host"=>{"subnet_id"=>"1", "name"=>"janvm01", "architecture_id"=>"1", "mac"=>"00:15:5D:FF:48:A7", "domain_id"=>"1", "owner_id"=>"1", "hostgroup_id"=>"3", "ptable_id"=>"1", "sp_subnet_id"=>"1", "ip"=>"128.142.194.47", "environment_id"=>"16", "model_id"=>"4", "operatingsystem_id"=>"3"}}

From https://foreman.mydomain.org/hosts/janvm01.mydomain.org?format=json

{"host":{"subnet_id":1,"serial":null,"puppetproxy_id":null,"name":"janvm01.mydomain.org","managed":true,"last_report":null,"comment":null,"architecture_id":1,"created_at":"2011-12-05T15:43:47Z","sp_mac":"","puppetmaster_name":"foreman.mydomain.org","image_file":null,"updated_at":"2011-12-05T15:43:47Z","sp_name":"","mac":"00:15:5d:ff:48:a7","installed_at":null,"domain_id":1,"use_image":null,"root_pass":"XXXXXXXXXXXXXXXXXXXXX","owner_id":6,"medium_id":6,"id":248,"hostgroup_id":3,"enabled":true,"build":false,"ptable_id":1,"sp_subnet_id":1,"puppet_status":0,"last_freshcheck":null,"ip":"128.142.194.47","environment_id":16,"source_file_id":null,"model_id":4,"environment":{"environment":{"name":"production","id":16}},"sp_ip":"","disk":null,"owner_type":"User","operatingsystem_id":3,"last_compile":null}}

100% reproducible.

cheers, Jan
Actions

Also available in: Atom PDF