Skip to content

Commit

Permalink
Add Redfish provider creation dialog
Browse files Browse the repository at this point in the history
This commit introduces minimal changes that are needed in order to be
able to add Redfish provider to ManageIQ.
  • Loading branch information
Tadej Borovšak committed May 8, 2018
1 parent 5624822 commit 1adf6ae
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 1 deletion.
119 changes: 119 additions & 0 deletions app/assets/images/svg/vendor-redfish.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions app/assets/images/svg/vendor-redfish_ph_infra.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def get_task_args(ems)
[user, params[:default_password], endpoint_opts]
when 'ManageIQ::Providers::Lenovo::PhysicalInfraManager'
[user, password, params[:default_hostname], params[:default_api_port], "token", false, true]
when 'ManageIQ::Providers::Redfish::PhysicalInfraManager'
[user, password, params[:default_hostname], params[:default_api_port],
params[:default_security_protocol]]
end
end

Expand Down Expand Up @@ -643,6 +646,11 @@ def set_ems_record_vars(ems, mode = nil)
default_endpoint = {:role => :default, :hostname => hostname, :port => port}
end

if ems.kind_of?(ManageIQ::Providers::Redfish::PhysicalInfraManager)
default_endpoint = {role: :default, hostname: hostname, port: port,
security_protocol: ems.security_protocol}
end

new_options = {}
if ems.class.respond_to?(:advanced_settings)
ems.class.advanced_settings.each do |section_name, section|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ng-if" => "emsCommonModel.emstype == 'openstack' || " + |
"emsCommonModel.emstype == 'openstack_infra' || " + |
"emsCommonModel.emstype == 'nuage_network' || " + |
"emsCommonModel.emstype == 'redfish_ph_infra' || " + |
"(emsCommonModel.emstype == 'vmware_cloud' && '#{prefix}' === 'amqp') || " |
"emsCommonModel.emstype == 'scvmm' || " + |
"emsCommonModel.ems_controller == 'ems_container' || " + |
Expand All @@ -33,7 +34,7 @@
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'nuage_network'"}
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'nuage_network' || emsCommonModel.emstype == 'redfish_ph_infra'"}
- prefix == "amqp" ? security_protocols = @amqp_security_protocols : security_protocols = @nuage_security_protocols
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
Expand Down Expand Up @@ -161,6 +162,7 @@
"emsCommonModel.emstype == 'vmware_cloud' || " + |
"emsCommonModel.emstype == 'hawkular' || " + |
"emsCommonModel.emstype == 'lenovo_ph_infra' || " + |
"emsCommonModel.emstype == 'redfish_ph_infra' || " + |
"emsCommonModel.ems_controller == 'ems_container'"} |
%label.col-md-2.control-label{"for" => "#{prefix}_api_port"}
= _('API Port')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@
%div{"ng-if" => "#{ng_model}.emstype == 'gce' || " + |
"#{ng_model}.emstype == 'scvmm' || " + |
"#{ng_model}.emstype == 'lenovo_ph_infra' || " + |
"#{ng_model}.emstype == 'redfish_ph_infra' || " + |
"#{ng_model}.emstype == 'hawkular'"} |
:javascript
miq_tabs_show_hide("#amqp_tab", false);
Expand Down

0 comments on commit 1adf6ae

Please sign in to comment.