Project

General

Profile

Bug #24199

Assigning environment on host create doesn't check the assignment of organization/location

Added by Ivan Necas 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1595161
Steps to Reproduce:

1. make sure the puppet environment has puppet classes, but is not assigned to the organization or location that the host will be created in
1. # hammer -d -v -u admin -p changeme host create --architecture-id="1" --domain-id="4" --environment-id="6" --ip="186.107.94.90" --location-id="2" --mac="4c:f7:c4:84:e2:92" --medium-id="11" --name="jhutar$RANDOM" --operatingsystem-id="2" --organization-id="1" --partition-table-id="94" --puppet-class-ids="6" --root-password="..."

Actual results:
The host is created, without any warning, but assignment of puppet classes is wrong at the end

Expected results:
The hammer command fails with error, that the provided environment doesn't belong to the organization/location


Related issues

Related to Foreman - Bug #24348: hammer host create returns ISE when LibVirt compute-resource is not in correct organizationClosed
Related to Foreman - Bug #24647: Assigning environment on hostgroup create doesn't check the assignment of organization/locationClosed
Copied to Katello - Bug #24239: Katello host tests do not add puppet environment to orgs/locsClosed2018-07-09

Associated revisions

Revision 488a94b5 (diff)
Added by Ivan Necas 5 months ago

Fixes #24199 - validate taxonomy of host environment on create (#5793)

  • Fixes #24199 - validate taxonomy of host environment on create

Otherwise, we allowed assigning the environment from different
organization/location to host and it was not consistent with the UI
behaviour.

It was also causing strange behavior when it comes to the assignment of
puppet classes.

History

#1 Updated by The Foreman Bot 5 months ago

  • Assignee set to Ivan Necas
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5793 added

#2 Updated by Stephen Benjamin 5 months ago

  • Copied to Bug #24239: Katello host tests do not add puppet environment to orgs/locs added

#3 Updated by Marek Hulán 5 months ago

  • Related to Bug #24348: hammer host create returns ISE when LibVirt compute-resource is not in correct organization added

#4 Updated by Marek Hulán 5 months ago

  • Target version set to 1.20.0
  • Subject changed from Assigning environment on host create doesn't check the assignment of organization/location to Assigning environment on host create doesn't check the assignment of organization/location
  • Fixed in Releases 1.20.0 added

#5 Updated by Ivan Necas 5 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Lukas Zapletal 4 months ago

  • Related to Bug #24647: Assigning environment on hostgroup create doesn't check the assignment of organization/location added

Also available in: Atom PDF