Skip to content

Commit

Permalink
Add methods for provider mapping supportability in ExtManagementSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Nov 5, 2020
1 parent adee4e3 commit c984ffb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ def self.supported_for_catalog?
catalog_types.present?
end

def self.label_mapping_classes
supported_subclasses.select(&:supports_label_mapping?)
end

def self.label_mapping_prefixes
label_mapping_classes.map(&:label_mapping_prefix)
end

def self.entities_for_label_mapping
label_mapping_classes.reduce({}) { |all_mappings, klass| all_mappings.merge(klass.entities_for_label_mapping) }
end

def self.provider_create_params
supported_types_for_create.each_with_object({}) do |ems_type, create_params|
create_params[ems_type.name] = ems_type.params_for_create if ems_type.respond_to?(:params_for_create)
Expand Down
1 change: 1 addition & 0 deletions app/models/mixins/supports_feature_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module SupportsFeatureMixin
:launch_html5_console => 'Launch HTML5 Console',
:launch_vmrc_console => 'Launch VMRC Console',
:launch_native_console => 'Launch Native Console',
:label_mapping => 'Label Mapping',
:admin_ui => 'Open Admin UI for a Provider',
:live_migrate => 'Live Migration',
:warm_migrate => 'Warm Migration',
Expand Down

0 comments on commit c984ffb

Please sign in to comment.