Skip to content

Commit

Permalink
Merge pull request ManageIQ#3120 from karelhala/revert-2436-mwPolicies
Browse files Browse the repository at this point in the history
Revert "Enable MW Compliance and Control policies"
  • Loading branch information
mzazrivec committed Dec 21, 2017
2 parents 768a1b6 + 0866df2 commit f5d01fc
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 42 deletions.
8 changes: 1 addition & 7 deletions app/controllers/application_controller/policy_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ def assign_policies(db)
end
end
%w(image instance vm miq_template
container
container_replicator
container_group
container_node
container_image
ems_container
middleware_server).each do |old_name|
container container_replicator container_group container_node container_image ems_container).each do |old_name|
alias_method "#{old_name}_protect".to_sym, :assign_policies
end

Expand Down
9 changes: 1 addition & 8 deletions app/controllers/application_controller/tree_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ def squash_toggle
def find_record
# TODO: This logic should probably be reversed - fixed list for VmOrTemplate.
# (Better yet, override the method only in VmOrTemplate related controllers.)
if %w(host
container_replicator
container_group
container_node
container_image
ext_management_system
physical_server
middleware_server).include?(controller_name)
if %w(host container_replicator container_group container_node container_image ext_management_system physical_server).include? controller_name
identify_record(params[:id], controller_name.classify)
else
identify_record(params[:id], VmOrTemplate)
Expand Down
12 changes: 1 addition & 11 deletions app/controllers/miq_policy_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ class MiqPolicyController < ApplicationController
after_action :cleanup_action
after_action :set_session_data

UI_FOLDERS = [
Host,
Vm,
ContainerReplicator,
ContainerGroup,
ContainerNode,
ContainerImage,
ExtManagementSystem,
PhysicalServer,
MiddlewareServer
].freeze
UI_FOLDERS = [Host, Vm, ContainerReplicator, ContainerGroup, ContainerNode, ContainerImage, ExtManagementSystem, PhysicalServer].freeze

def export
@breadcrumbs = []
Expand Down
2 changes: 0 additions & 2 deletions app/decorators/miq_policy_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def fonticon
'pficon pficon-server'
when 'PhysicalServer'
'pficon pficon-enterprise'
when 'MiddlewareServer'
'pficon pficon-middleware'
end
"#{icon}#{active ? '' : ' fa-inactive'}"
end
Expand Down
5 changes: 1 addition & 4 deletions app/presenters/tree_builder_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def self.folder_icon(klassname)
'pficon pficon-server'
when 'PhysicalServer'
'pficon pficon-enterprise'
when 'MiddlewareServer'
'pficon pficon-middleware'
end
end

Expand All @@ -51,8 +49,7 @@ def x_get_tree_roots(count_only, _options)
:ContainerNode => _("Container Node Conditions"),
:ContainerImage => _("Container Image Conditions"),
:ExtManagementSystem => _("Provider Conditions"),
:PhysicalServer => _("Physical Infrastructure Conditions"),
:MiddlewareServer => _("Middleware Server Conditions")}
:PhysicalServer => _("Physical Infrastructure Conditions")}

objects = MiqPolicyController::UI_FOLDERS.collect do |model|
text = text_i18n[model.name.to_sym]
Expand Down
8 changes: 2 additions & 6 deletions app/presenters/tree_builder_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ def compliance_control_kids(mode)
:ContainerNode => _("Container Node Compliance Policies"),
:ContainerImage => _("Container Image Compliance Policies"),
:ExtManagementSystem => _("Provider Compliance Policies"),
:PhysicalServer => _("Physical Infrastructure Compliance Policies"),
:MiddlewareServer => _("Middleware Server Compliance Policies")},
:PhysicalServer => _("Physical Infrastructure Compliance Policies")},
:control => {:Host => _("Host Control Policies"),
:Vm => _("Vm Control Policies"),
:ContainerReplicator => _("Replicator Control Policies"),
:ContainerGroup => _("Pod Control Policies"),
:ContainerNode => _("Container Node Control Policies"),
:ContainerImage => _("Container Image Control Policies"),
:ExtManagementSystem => _("Provider Control Policies"),
:PhysicalServer => _("Physical Infrastructure Control Policies"),
:MiddlewareServer => _("Middleware Server Control Policies")}}
:PhysicalServer => _("Physical Infrastructure Control Policies")}}

MiqPolicyController::UI_FOLDERS.collect do |model|
text = text_i18n[mode.to_sym][model.name.to_sym]
Expand All @@ -53,8 +51,6 @@ def compliance_control_kids(mode)
'pficon pficon-server'
when 'PhysicalServer'
'pficon pficon-enterprise'
when 'MiddlewareServer'
'pficon pficon-middleware'
end
{
:id => "#{mode}-#{model.name.camelize(:lower)}",
Expand Down
2 changes: 0 additions & 2 deletions app/presenters/tree_builder_protect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def x_get_tree_hash_kids(parent, count_only)
'pficon pficon-server'
when 'PhysicalServer'
'pficon pficon-enterprise'
when 'MiddlewareServer'
'pficon pficon-middleware'
end
{
:id => "policy_#{policy.id}",
Expand Down
2 changes: 0 additions & 2 deletions app/views/miq_policy/_policy_folders.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"Container Image Compliance" => _("Container Image Compliance Policies"),
"Ext Management System Compliance" => _("Provider Compliance Policies"),
"Physical Server Compliance" => _("Physical Infrastructure Compliance Policies"),
"Middleware Server Compliance" => _("Middleware Server Compliance Policies"),
"Host Control" => _("Host Control Policies"),
"Vm Control" => _("Vm Control Policies"),
"Container Replicator Control" => _("Replicator Control Policies"),
Expand All @@ -18,7 +17,6 @@
"Container Image Control" => _("Container Image Control Policies"),
"Ext Management System Control" => _("Provider Control Policies"),
"Physical Server Control" => _("Physical Infrastructure Control Policies"),
"Middleware Server Control" => _("Middleware Server Control Policies"),
}
= render :partial => "layouts/flash_msg"
%table.table.table-striped.table-bordered.table-hover
Expand Down

0 comments on commit f5d01fc

Please sign in to comment.