Skip to content

Commit 76114da

Browse files
committed
Merge pull request #140 from shefaliv/resizingupdate
HDInsight - bug fix in cmdlet - TFS Defect 4123936
2 parents 3dd3adf + a6336e1 commit 76114da

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/SetAzureHDInsightClusterSizeCmdlet.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Reflection;
2020
using System.Security.Cryptography.X509Certificates;
2121
using System.Threading.Tasks;
22+
using Microsoft.WindowsAzure.Management.HDInsight.ClusterProvisioning.Data;
2223
using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandInterfaces;
2324
using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects;
2425
using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters;
@@ -159,11 +160,19 @@ protected override void EndProcessing()
159160
command.Location = cluster.Location;
160161
if (ClusterSizeInNodes < cluster.ClusterSizeInNodes)
161162
{
162-
var task = ConfirmSetAction(
163-
"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?",
164-
"Continuing with set cluster operation.",
165-
ClusterSizeInNodes.ToString(CultureInfo.InvariantCulture),
166-
action);
163+
Task task;
164+
if (cluster.ClusterType == ClusterType.Hadoop)
165+
{
166+
task = ConfirmSetAction(
167+
"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?",
168+
"Continuing with set cluster operation.",
169+
ClusterSizeInNodes.ToString(CultureInfo.InvariantCulture),
170+
action);
171+
}
172+
else
173+
{
174+
task = action();
175+
}
167176
if (task == null)
168177
{
169178
throw new OperationCanceledException("The change cluster size operation was aborted.");

0 commit comments

Comments
 (0)