Skip to content

Commit

Permalink
Merge pull request #16700 from kruge002/ReconfigureNetwork
Browse files Browse the repository at this point in the history
Reconfigure VM: Add / Remove Network Adapters
  • Loading branch information
gmcculloug authored Feb 13, 2018
2 parents 04aea3e + 3d5b4d9 commit 6a0dc62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
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 @@ -107,6 +107,7 @@ module SupportsFeatureMixin
:reconfigure => 'Reconfiguration',
:reconfigure_disks => 'Reconfigure Virtual Machines Disks',
:reconfigure_disksize => 'Reconfigure Virtual Machines Disk Size',
:reconfigure_network_adapters => 'Reconfigure Network Adapters',
:refresh_network_interfaces => 'Refresh Network Interfaces for a Host',
:refresh_new_target => 'Refresh non-existing record',
:regions => 'Regions of a Provider',
Expand Down
16 changes: 9 additions & 7 deletions app/models/vm_reconfigure_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ def self.get_description(req_obj)
end

new_settings = []
unless req_obj.options[:vm_memory].blank?
if req_obj.options[:vm_memory].present?
new_settings << "Memory: #{req_obj.options[:vm_memory].to_i} MB"
end
new_settings << "Processor Sockets: #{req_obj.options[:number_of_sockets].to_i}" unless req_obj.options[:number_of_sockets].blank?
new_settings << "Processor Cores Per Socket: #{req_obj.options[:cores_per_socket].to_i}" unless req_obj.options[:cores_per_socket].blank?
new_settings << "Total Processors: #{req_obj.options[:number_of_cpus].to_i}" unless req_obj.options[:number_of_cpus].blank?
new_settings << "Add Disks: #{req_obj.options[:disk_add].length}" unless req_obj.options[:disk_add].blank?
new_settings << "Remove Disks: #{req_obj.options[:disk_remove].length}" unless req_obj.options[:disk_remove].blank?
new_settings << "Resize Disks: #{req_obj.options[:disk_resize].length}" unless req_obj.options[:disk_resize].blank?
new_settings << "Processor Sockets: #{req_obj.options[:number_of_sockets].to_i}" if req_obj.options[:number_of_sockets].present?
new_settings << "Processor Cores Per Socket: #{req_obj.options[:cores_per_socket].to_i}" if req_obj.options[:cores_per_socket].present?
new_settings << "Total Processors: #{req_obj.options[:number_of_cpus].to_i}" if req_obj.options[:number_of_cpus].present?
new_settings << "Add Disks: #{req_obj.options[:disk_add].length}" if req_obj.options[:disk_add].present?
new_settings << "Remove Disks: #{req_obj.options[:disk_remove].length}" if req_obj.options[:disk_remove].present?
new_settings << "Resize Disks: #{req_obj.options[:disk_resize].length}" if req_obj.options[:disk_resize].present?
new_settings << "Add Network Adapters: #{req_obj.options[:network_adapter_add].length}" if req_obj.options[:network_adapter_add].present?
new_settings << "Remove Network Adapters: #{req_obj.options[:network_adapter_remove].length}" if req_obj.options[:network_adapter_remove].present?
"#{request_class::TASK_DESCRIPTION} for: #{name} - #{new_settings.join(", ")}"
end

Expand Down

0 comments on commit 6a0dc62

Please sign in to comment.