Add Puppet environment bulk actions - #443
Conversation
7b47350 to
b3a99a0
Compare
6e4a70a to
a6a902f
Compare
|
|
||
| const handleError = response => { | ||
| handleModalClose(); | ||
| dispatch( |
There was a problem hiding this comment.
is it possible to re-use https://github.com/theforeman/foreman/pull/11045/changes ?
There was a problem hiding this comment.
Yeah, and also theforeman/foreman#11110 I guess
There was a problem hiding this comment.
is it possible to re-use https://github.com/theforeman/foreman/pull/11045/changes ?
I have not yet added this part. We can do it as a follow-up and also change the other bulk action to use that error handling so that it is consistent for all actions of the plugin.
| p.actions << 'foreman_puppet/api/v2/hosts_bulk_actions/change_environment' | ||
| p.actions << 'foreman_puppet/api/v2/hosts_bulk_actions/change_puppet_proxy' | ||
| p.actions << 'foreman_puppet/api/v2/hosts_bulk_actions/remove_puppet_proxy' |
There was a problem hiding this comment.
These might need changing based on the result in the above comment.
|
|
||
| def put_change_environment(params:, session: nil) | ||
| original_routes = @routes | ||
| @routes = ForemanPuppet::Engine.routes |
There was a problem hiding this comment.
This would also be obsolete, when api_routes is changed.
| inherited_environment = FactoryBot.create(:environment, organizations: [organization], locations: [location]) | ||
| hostgroup = FactoryBot.create(:hostgroup, :with_puppet_enc, | ||
| environment: inherited_environment, | ||
| organizations: [organization], | ||
| locations: [location]) | ||
| inherited_hosts = FactoryBot.create_list(:host, 2, :with_puppet_enc, | ||
| environment: inherited_environment, | ||
| hostgroup: hostgroup, | ||
| organization: organization, | ||
| location: location) |
There was a problem hiding this comment.
The test setup should not already fulfill the test-assertion.
| inherited_environment = FactoryBot.create(:environment, organizations: [organization], locations: [location]) | |
| hostgroup = FactoryBot.create(:hostgroup, :with_puppet_enc, | |
| environment: inherited_environment, | |
| organizations: [organization], | |
| locations: [location]) | |
| inherited_hosts = FactoryBot.create_list(:host, 2, :with_puppet_enc, | |
| environment: inherited_environment, | |
| hostgroup: hostgroup, | |
| organization: organization, | |
| location: location) | |
| inherited_environment = FactoryBot.create(:environment, organizations: [organization], locations: [location]) | |
| host_environment = FactoryBot.create(:environment, organizations: [organization], locations: [location]) | |
| hostgroup = FactoryBot.create(:hostgroup, :with_puppet_enc, | |
| environment: inherited_environment, | |
| organizations: [organization], | |
| locations: [location]) | |
| inherited_hosts = FactoryBot.create_list(:host, 2, :with_puppet_enc, | |
| environment: host_environment, | |
| hostgroup: hostgroup, | |
| organization: organization, | |
| location: location) | |
| assert_not_equal host_environment, inherited_environment |
44e2646 to
88f0454
Compare
Co-Authored-By: OpenAI Codex <codex@openai.com>
88f0454 to
999e56b
Compare
Generated-by: OpenAI Codex codex@openai.com