From a935b90ceb1b6dc1c45dac5f8a19d7ecb31e39b0 Mon Sep 17 00:00:00 2001 From: mcabrerizo Date: Wed, 26 Apr 2017 09:10:57 +0200 Subject: [PATCH] F #4913: Remove RP confinement in cluster import wizard (CLI and Sunstone) --- .../public/app/utils/vcenter/clusters.js | 32 ++++++------------- .../public/app/utils/vcenter/clusters/row.hbs | 1 - .../remotes/lib/vcenter_driver/importer.rb | 24 -------------- 3 files changed, 9 insertions(+), 48 deletions(-) diff --git a/src/sunstone/public/app/utils/vcenter/clusters.js b/src/sunstone/public/app/utils/vcenter/clusters.js index f34038481a..fd90b34404 100644 --- a/src/sunstone/public/app/utils/vcenter/clusters.js +++ b/src/sunstone/public/app/utils/vcenter/clusters.js @@ -93,7 +93,6 @@ define(function(require) { columns : [ '', Locale.tr("Name"), - Locale.tr("Resource Pool"), "" ] }); @@ -110,7 +109,7 @@ define(function(require) { } } rp_list += ''; - var opts = { name: cluster_name , rp: rp_list}; + var opts = { name: cluster_name }; var trow = $(RowTemplate(opts)).appendTo(tbody); $(".check_item", trow).data("cluster", cluster); @@ -172,8 +171,6 @@ define(function(require) { VCenterCommon.importLoading({context : row_context}); - var rp = $('.select_rp option:selected', row_context).val(); - var host_json = { "host": { "name": $(this).data("cluster").cluster_name, @@ -183,7 +180,7 @@ define(function(require) { "cluster_id": cluster_id } }; - + var cluster_ref = $(this).data("cluster").cluster_ref; var vcenter_uuid = $(this).data("cluster").vcenter_uuid; var vcenter_version = $(this).data("cluster").vcenter_version; @@ -197,24 +194,13 @@ define(function(require) { message : Locale.tr("Host created successfully. ID: %1$s", response.HOST.ID) }); - if(rp != ""){ - var template_raw = - "VCENTER_USER=\"" + that.opts.vcenter_user + "\"\n" + - "VCENTER_PASSWORD=\"" + that.opts.vcenter_password + "\"\n" + - "VCENTER_HOST=\"" + that.opts.vcenter_host + "\"\n" + - "VCENTER_INSTANCE_ID=\"" + vcenter_uuid + "\"\n" + - "VCENTER_CCR_REF=\"" + cluster_ref + "\"\n" + - "VCENTER_VERSION=\"" + vcenter_version + "\"\n" + - "VCENTER_RESOURCE_POOL=\"" + rp + "\"\n"; - } else { - var template_raw = - "VCENTER_USER=\"" + that.opts.vcenter_user + "\"\n" + - "VCENTER_PASSWORD=\"" + that.opts.vcenter_password + "\"\n" + - "VCENTER_HOST=\"" + that.opts.vcenter_host + "\"\n" + - "VCENTER_INSTANCE_ID=\"" + vcenter_uuid + "\"\n" + - "VCENTER_CCR_REF=\"" + cluster_ref + "\"\n" + - "VCENTER_VERSION=\"" + vcenter_version + "\"\n"; - } + var template_raw = + "VCENTER_USER=\"" + that.opts.vcenter_user + "\"\n" + + "VCENTER_PASSWORD=\"" + that.opts.vcenter_password + "\"\n" + + "VCENTER_HOST=\"" + that.opts.vcenter_host + "\"\n" + + "VCENTER_INSTANCE_ID=\"" + vcenter_uuid + "\"\n" + + "VCENTER_CCR_REF=\"" + cluster_ref + "\"\n" + + "VCENTER_VERSION=\"" + vcenter_version + "\"\n"; Sunstone.runAction("Host.update_template", response.HOST.ID, template_raw); }, diff --git a/src/sunstone/public/app/utils/vcenter/clusters/row.hbs b/src/sunstone/public/app/utils/vcenter/clusters/row.hbs index d1bdfe78e8..088d0928bb 100644 --- a/src/sunstone/public/app/utils/vcenter/clusters/row.hbs +++ b/src/sunstone/public/app/utils/vcenter/clusters/row.hbs @@ -19,7 +19,6 @@ {{name}} - {{{rp}}}   diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/importer.rb b/src/vmm_mad/remotes/lib/vcenter_driver/importer.rb index d83fcb9663..dd26a03bda 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/importer.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/importer.rb @@ -126,30 +126,6 @@ def self.import_clusters(con_ops, options) answer = STDIN.gets.strip one_cluster_id = answer if !answer.empty? end - - rpools = cluster[:rp_list] - - if !rpools.empty? - - STDOUT.print "\n Do you want to confine this cluster in "\ - "a resource pool (y/[n])? " - - if STDIN.gets.strip.downcase == 'y' - - rpool_list = "" - rpools.each do |rp| - rpool_list << " - " << rp[:name] << "\n" - end - - STDOUT.print "\n Please specify one resource pool from "\ - "the following list:\n\n#{rpool_list}" - - STDOUT.print "\n Your resource pool choice: " - - answer = STDIN.gets.strip - rpool = answer if !answer.empty? - end - end end one_host = VCenterDriver::ClusterComputeResource.to_one(cluster,