From a6336e16e5825f588a6f0f8a83559b8de66a7d94 Mon Sep 17 00:00:00 2001 From: Shefali Date: Tue, 3 Feb 2015 19:59:01 -0800 Subject: [PATCH] making confirm only for hadoop --- .../SetAzureHDInsightClusterSizeCmdlet.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/SetAzureHDInsightClusterSizeCmdlet.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/SetAzureHDInsightClusterSizeCmdlet.cs index 0a6c44eec408..2c644c4da507 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/SetAzureHDInsightClusterSizeCmdlet.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/SetAzureHDInsightClusterSizeCmdlet.cs @@ -19,6 +19,7 @@ using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; +using Microsoft.WindowsAzure.Management.HDInsight.ClusterProvisioning.Data; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters; @@ -159,11 +160,19 @@ protected override void EndProcessing() command.Location = cluster.Location; if (ClusterSizeInNodes < cluster.ClusterSizeInNodes) { - var task = ConfirmSetAction( - "You are requesting a cluster size that is less than the current cluster size. We recommend not running jobs till the operation is complete as all running jobs will fail at end of resize operation and may impact the health of your cluster. Do you want to continue?", - "Continuing with set cluster operation.", - ClusterSizeInNodes.ToString(CultureInfo.InvariantCulture), - action); + Task task; + if (cluster.ClusterType == ClusterType.Hadoop) + { + task = ConfirmSetAction( + "You are requesting a cluster size that is less than the current cluster size. We recommend not running jobs till the operation is complete as all running jobs will fail at end of resize operation and may impact the health of your cluster. Do you want to continue?", + "Continuing with set cluster operation.", + ClusterSizeInNodes.ToString(CultureInfo.InvariantCulture), + action); + } + else + { + task = action(); + } if (task == null) { throw new OperationCanceledException("The change cluster size operation was aborted.");