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 24, 2018
1 parent c13a47d commit 2c25aeb
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
65 changes: 65 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.
1 change: 1 addition & 0 deletions app/assets/images/svg/vendor-redfish_ph_infra.svg
1 change: 1 addition & 0 deletions app/controllers/ems_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def form_instance_vars
end
@nuage_api_versions = retrieve_nuage_api_versions
@hawkular_security_protocols = retrieve_hawkular_security_protocols
@redfish_security_protocols = retrieve_security_protocols
end

def retrieve_provider_regions
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,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 @@ -648,6 +651,15 @@ 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
10 changes: 10 additions & 0 deletions app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml
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 Down Expand Up @@ -70,6 +71,14 @@
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'redfish_ph_infra'"}
- security_protocols = @redfish_security_protocols
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => defined?(security_protocol_not_required) ? false : true,
"selectpicker-for-select-tag" => "")

%div{"ng-if" => defined?(hostname_hide) ? false : true}
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_hostname.$invalid}"}
Expand Down Expand Up @@ -161,6 +170,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 2c25aeb

Please sign in to comment.