Skip to content

Commit

Permalink
Remove references to host provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcculloug committed Jun 19, 2018
1 parent a57956f commit b0040ec
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 65 deletions.
40 changes: 10 additions & 30 deletions app/controllers/application_controller/miq_request_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def sort_vm_grid
# get the sort column that was clicked on, else use the current one
def sort_host_grid
return unless load_edit("prov_edit__#{params[:id]}", "show_list")
@edit[:wf].kind_of?(MiqHostProvisionWorkflow) ? sort_grid('host', @edit[:wf].get_field(:src_host_ids, :service)[:values]) : sort_grid('host', @edit[:wf].get_field(:placement_host_name, :environment)[:values])
sort_grid('host', @edit[:wf].get_field(:placement_host_name, :environment)[:values])
end

# get the sort column that was clicked on, else use the current one
Expand Down Expand Up @@ -430,23 +430,13 @@ def build_host_grid(hosts, sort_order = nil, sort_by = nil)
# need to set options from @edit/@option based upon calling screen: show/edit
options = @edit || @options

headers = if options[:wf].kind_of?(MiqHostProvisionWorkflow)
# non-editable grid for host prov to display hosts being provisioned
{
"name" => _("Name"),
"mac_address" => _("MAC Address"),
}
else
# editable grid for vm/migrate prov screens
{
"name" => _("Name"),
"v_total_vms" => _("Total VMs"),
"vmm_product" => _("Platform"),
"vmm_version" => _("Version"),
"state" => _("State"),
"maintenance" => _("Maintenance")
}
end
# editable grid for vm/migrate prov screens
headers = { "name" => _("Name"),
"v_total_vms" => _("Total VMs"),
"vmm_product" => _("Platform"),
"vmm_version" => _("Version"),
"state" => _("State"),
"maintenance" => _("Maintenance") }

integer_fields = %w(v_total_vms)

Expand Down Expand Up @@ -519,7 +509,6 @@ def dialog_partial_for_workflow
case workflow
when MiqProvisionVirtWorkflow then "shared/views/prov_dialog"
when ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow then "prov_configured_system_foreman_dialog"
when MiqHostProvisionWorkflow then "prov_host_dialog"
when VmMigrateWorkflow then "prov_vm_migrate_dialog"
when PhysicalServerProvisionWorkflow then "prov_physical_server_dialog"
end
Expand Down Expand Up @@ -769,7 +758,7 @@ def prov_get_form_vars
def prov_set_show_vars
@showtype = "main"
@options = @miq_request.get_options # Get the provision options from the request record
@options[:org_controller] = @miq_request.resource_type == "MiqHostProvisionRequest" ? "host" : "vm"
@options[:org_controller] = "vm"
if @options[:schedule_time]
@options[:schedule_time] = format_timezone(@options[:schedule_time], Time.zone, "raw")
@options[:start_date] = "#{@options[:schedule_time].month}/#{@options[:schedule_time].day}/#{@options[:schedule_time].year}" # Set the start date
Expand All @@ -794,7 +783,7 @@ def prov_set_show_vars
end
end
@options[tag_symbol_for_workflow] ||= [] # Initialize if came back nil from record
unless ["MiqHostProvisionRequest", "VmMigrateRequest"].include?(@miq_request.resource_type)
unless ["VmMigrateRequest"].include?(@miq_request.resource_type)
svm = VmOrTemplate.where(:id => @options[:src_vm_id][0]).first if @options[:src_vm_id] && @options[:src_vm_id][0]
@sb[:vm_os] = svm.platform if svm
end
Expand Down Expand Up @@ -946,8 +935,6 @@ def workflow_instance_from_vars(req)
MiqProvisionWorkflow.class_for_platform(@edit[:st_prov_type])
elsif @edit[:new][:st_prov_type]
MiqProvisionWorkflow.class_for_platform(@edit[:new][:st_prov_type])
else # handle copy button for host provisioning
MiqHostProvisionWorkflow
end
pre_prov_values = copy_hash(@edit[:wf].values) if @edit[:wf]

Expand All @@ -962,13 +949,6 @@ def workflow_instance_from_vars(req)
@edit[:prov_type] = "PhysicalServer"
@edit[:new][:src_configured_system_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
wf_type = PhysicalServerProvisionWorkflow
else
@edit[:prov_type] = "Host"
if @edit[:new].empty?
# multiple / single hosts selected, src_host_ids should always be an array
@edit[:new][:src_host_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
end
wf_type = MiqHostProvisionWorkflow
end

[wf_type.new(@edit[:new], current_user, options), pre_prov_values] # Return the new workflow and any pre_prov_values
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/miq_request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ def prov_continue

def prov_load_tab
if @options && @options[:current_tab_key] == :purpose # Need to build again for purpose tab
fld = @options[:wf].kind_of?(MiqHostProvisionWorkflow) ? "tag_ids" : "vm_tags"
build_tags_tree(@options[:wf], @options[fld.to_s.to_sym], false)
build_tags_tree(@options[:wf], @options[:vm_tags], false)
end
# need to build host list view, to display on show screen
@options[:host_sortdir] = "ASC"
Expand Down
1 change: 0 additions & 1 deletion app/decorators/miq_event_definition_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def fonticon
"host_disconnect" => "pficon pficon-screen",
"host_failure" => "pficon pficon-screen",
"host_perf_complete" => "pficon pficon-screen",
"host_provisioned" => "pficon pficon-screen",
"host_remove_from_cluster" => "pficon pficon-screen",
"host_scan_complete" => "pficon pficon-screen",
"request_assign_company_tag" => "fa fa-tag",
Expand Down
1 change: 0 additions & 1 deletion app/helpers/application_helper/button/miq_request_copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class ApplicationHelper::Button::MiqRequestCopy < ApplicationHelper::Button::Miq
def visible?
return false unless super
resource_types_for_miq_request_copy = %w(MiqProvisionRequest
MiqHostProvisionRequest
MiqProvisionConfiguredSystemRequest)
return false if !resource_types_for_miq_request_copy.include?(@record.resource_type) ||
((current_user.name != @record.requester_name ||
Expand Down
20 changes: 0 additions & 20 deletions app/helpers/application_helper/toolbar/hosts_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,26 +160,6 @@ class ApplicationHelper::Toolbar::HostsCenter < ApplicationHelper::Toolbar::Basi
]
),
])
button_group('host_lifecycle', [
select(
:host_lifecycle_choice,
'fa fa-recycle fa-lg',
t = N_('Lifecycle'),
t,
:items => [
button(
:host_miq_request_new,
'pficon pficon-add-circle-o fa-lg',
N_('Request to Provision items'),
N_('Provision items'),
:url_parms => "main_div",
:send_checked => true,
:enabled => false,
:onwhen => "1+",
:klass => ApplicationHelper::Button::ButtonNewDiscover),
]
),
])
button_group('host_operations', [
select(
:host_power_choice,
Expand Down
1 change: 0 additions & 1 deletion app/presenters/menu/default_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def infrastructure_menu_section
Menu::Item.new('storage', N_('Datastores'), 'storage', {:feature => 'storage_show_list'}, '/storage/explorer'),
Menu::Item.new('pxe', N_('PXE'), 'pxe', {:feature => 'pxe', :any => true}, '/pxe/explorer'),
Menu::Item.new('switch', N_('Networking'), 'infra_networking', {:feature => 'infra_networking', :any => true}, '/infra_networking/explorer'),
Menu::Item.new('miq_request_host', N_('Requests'), 'host_miq_request', {:feature => 'host_miq_request_show_list'}, '/miq_request?typ=host'),
Menu::Item.new('infra_topology', N_('Topology'), 'infra_topology', {:feature => 'infra_topology', :any => true}, '/infra_topology')
])
end
Expand Down
7 changes: 0 additions & 7 deletions app/views/miq_request/_request.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@
.col-md-8{:onclick => "DoNav('#{'/miq_request/show/' << @miq_request.id.to_s << '?display=miq_provisions'}');",
:title => _("Click to view details")}
= h(@miq_request.resource.miq_provisions.length)
- if @miq_request.resource_type == "MiqHostProvisionRequest" && @miq_request.resource.miq_host_provisions.length > 0
.form-group
%label.control-label.col-md-2
= _("Provisioned Hosts")
.col-md-8{:title => _("Click to view details"),
:onclick => "DoNav('#{'/miq_request/show/' << @miq_request.id.to_s << '?display=miq_provisions'}');"}
= h(@miq_request.resource.miq_host_provisions.length)
- if @edit && @edit[:stamp_typ]
%table{:width => "100%"}
%tr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
let(:request) { "SomeRequest" }
let(:username) { user.name }
let(:state) { "xx" }
%w(MiqProvisionRequest MiqHostProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
%w(MiqProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
VmMigrateRequest AutomationRequest ServiceTemplateProvisionRequest).each do |cls|
context "id = miq_request_approval" do
before do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

let(:view_context) { setup_view_context_with_sandbox({}) }
let(:user) { FactoryGirl.create(:user) }
%w(MiqProvisionRequest MiqHostProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
%w(MiqProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
VmMigrateRequest AutomationRequest ServiceTemplateProvisionRequest).each do |cls|
let(:request) { "MiqProvisionRequest" }
let(:username) { user.name }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
let(:request) { "SomeRequest" }
let(:username) { user.name }
let(:state) { "xx" }
%w(MiqProvisionRequest MiqHostProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
%w(MiqProvisionRequest VmReconfigureRequest VmCloudReconfigureRequest
VmMigrateRequest AutomationRequest ServiceTemplateProvisionRequest).each do |cls|
context 'miq_request_edit' do
before do
Expand Down

0 comments on commit b0040ec

Please sign in to comment.