Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redfish provider creation dialog #3912

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -182,6 +182,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 @@ -658,6 +661,15 @@ def set_ems_record_vars(ems, mode = nil)
default_endpoint = {:role => :default, :hostname => uri.host, :port => uri.port, :path => uri.path, :url => params[:default_url]}
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 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 @@ -485,6 +485,7 @@
%div{"ng-if" => "#{ng_model}.emstype == 'gce' || " + |
"#{ng_model}.emstype == 'scvmm' || " + |
"#{ng_model}.emstype == 'lenovo_ph_infra' || " + |
"#{ng_model}.emstype == 'redfish_ph_infra' || " + |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is correct place to put it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is correct in the sense that the following code hides all the tabs that we do not need. I considered adding a separate block for Redfish provider, but I decided against it when I saw that other providers are already reusing the configuration block. Besides, we can always create a new block if/when we actually need to made some customizations.

"#{ng_model}.emstype == 'hawkular'"} |
:javascript
miq_tabs_show_hide("#amqp_tab", false);
Expand Down