Skip to content

Commit 6e65540

Browse files
committed
Modify ServiceManagementBaseCmdlet
1 parent 186b728 commit 6e65540

File tree

13 files changed

+75
-169
lines changed

13 files changed

+75
-169
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/BaseAzureServiceExtensionCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ protected DeploymentGetResponse GetDeployment(string slot)
280280
{
281281
if (ex.Response.StatusCode != HttpStatusCode.NotFound && IsVerbose() == false)
282282
{
283-
this.WriteExceptionDetails(ex);
283+
WriteExceptionError(ex);
284284
}
285285
}
286286
});

src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/GetAzureRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private DeploymentGetResponse GetCurrentDeployment(out OperationStatusResponse o
163163

164164
DeploymentGetResponse deploymentGetResponse = null;
165165
InvokeInOperationContext(() => deploymentGetResponse = this.ComputeClient.Deployments.GetBySlot(this.ServiceName, slot));
166-
operation = GetOperationNewSM(deploymentGetResponse.RequestId);
166+
operation = GetOperation(deploymentGetResponse.RequestId);
167167

168168
WriteVerboseWithTimestamp(Resources.GetDeploymentCompletedOperation);
169169

src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public virtual void NewPaaSDeploymentProcess()
170170
{
171171
if (ex.Response.StatusCode != HttpStatusCode.NotFound && IsVerbose() == false)
172172
{
173-
this.WriteExceptionDetails(ex);
173+
WriteExceptionError(ex);
174174
}
175175
}
176176

@@ -225,7 +225,7 @@ public virtual void NewPaaSDeploymentProcess()
225225
}
226226
catch (CloudException ex)
227227
{
228-
this.WriteExceptionDetails(ex);
228+
WriteExceptionError(ex);
229229
}
230230
});
231231
}
@@ -249,7 +249,7 @@ private void AssertNoPersistenVmRoleExistsInDeployment(string slot)
249249
{
250250
if (ex.Response.StatusCode != HttpStatusCode.NotFound && IsVerbose() == false)
251251
{
252-
this.WriteExceptionDetails(ex);
252+
WriteExceptionError(ex);
253253
}
254254
}
255255
});

src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void ExecuteCommand()
175175
{
176176
if (ex.Response.StatusCode != HttpStatusCode.NotFound && IsVerbose() == false)
177177
{
178-
this.WriteExceptionDetails(ex);
178+
WriteExceptionError(ex);
179179
}
180180
}
181181

@@ -263,7 +263,7 @@ public void ExecuteCommand()
263263
}
264264
catch (CloudException ex)
265265
{
266-
this.WriteExceptionDetails(ex);
266+
WriteExceptionError(ex);
267267
}
268268
});
269269
}

src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private DeploymentGetResponse GetCurrentDeployment(out OperationStatusResponse o
110110

111111
WriteVerboseWithTimestamp(Resources.GetDeploymentBeginOperation);
112112
DeploymentGetResponse deploymentGetResponse = this.ComputeClient.Deployments.GetBySlot(this.ServiceName, slot);
113-
operation = GetOperationNewSM(deploymentGetResponse.RequestId);
113+
operation = GetOperation(deploymentGetResponse.RequestId);
114114
WriteVerboseWithTimestamp(Resources.GetDeploymentCompletedOperation);
115115

116116
return deploymentGetResponse;

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/GetAzureVMDscExtensionStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ internal void GetCurrentDeployment()
150150
return;
151151

152152
CurrentDeploymentNewSM = ComputeClient.Deployments.GetBySlot(Service, NSM.DeploymentSlot.Production);
153-
GetDeploymentOperationNewSM = GetOperationNewSM(CurrentDeploymentNewSM.RequestId);
153+
GetDeploymentOperationNewSM = GetOperation(CurrentDeploymentNewSM.RequestId);
154154
WriteVerboseWithTimestamp(Resources.GetDeploymentCompletedOperation);
155155
}
156156
catch (CloudException ex)

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/IaaSDeploymentManagementCmdletBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected virtual void ExecuteCommand()
6868
try
6969
{
7070
CurrentDeploymentNewSM = this.ComputeClient.Deployments.GetBySlot(this.ServiceName, DeploymentSlot.Production);
71-
GetDeploymentOperationNewSM = GetOperationNewSM(CurrentDeploymentNewSM.RequestId);
71+
GetDeploymentOperationNewSM = GetOperation(CurrentDeploymentNewSM.RequestId);
7272
WriteVerboseWithTimestamp(Resources.GetDeploymentCompletedOperation);
7373
}
7474
catch (CloudException ex)

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureVNetConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public VirtualNetworkConfigContext GetVirtualNetworkConfigProcess()
4848
WriteVerboseWithTimestamp(string.Format(Resources.AzureVNetConfigBeginOperation, CommandRuntime.ToString()));
4949

5050
var netcfg = this.NetworkClient.Networks.GetConfiguration();
51-
var operation = GetOperationNewSM(netcfg.RequestId);
51+
var operation = GetOperation(netcfg.RequestId);
5252

5353
WriteVerboseWithTimestamp(string.Format(Resources.AzureVNetConfigCompletedOperation, CommandRuntime.ToString()));
5454

@@ -81,7 +81,7 @@ public VirtualNetworkConfigContext GetVirtualNetworkConfigProcess()
8181
}
8282
else
8383
{
84-
this.WriteExceptionDetails(ex);
84+
WriteExceptionError(ex);
8585
}
8686
}
8787
});

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureVNetSite.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public IEnumerable<VirtualNetworkSiteContext> GetVirtualNetworkSiteProcess()
6060
}
6161
}
6262

63-
var operation = GetOperationNewSM(response.RequestId);
63+
var operation = GetOperation(response.RequestId);
6464
WriteVerboseWithTimestamp(string.Format(Resources.AzureVNetSiteCompletedOperation, CommandRuntime.ToString()));
6565
result = sites.Select(site => ContextFactory<NetworkListResponse.VirtualNetworkSite, VirtualNetworkSiteContext>(site, operation));
6666
}
@@ -72,7 +72,7 @@ public IEnumerable<VirtualNetworkSiteContext> GetVirtualNetworkSiteProcess()
7272
}
7373
else
7474
{
75-
this.WriteExceptionDetails(ex);
75+
WriteExceptionError(ex);
7676
}
7777
}
7878
});

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/GetAzureRemoteDesktopFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected override void ExecuteCommand()
7979
}
8080
}
8181

82-
var operation = GetOperationNewSM(desktopFileResponse.RequestId);
82+
var operation = GetOperation(desktopFileResponse.RequestId);
8383

8484
WriteVerboseWithTimestamp(string.Format(Resources.AzureRemoteDesktopCompletedOperation, CommandRuntime));
8585

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureQuickVM.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public void NewAzureVMProcess()
238238
}
239239
catch (CloudException ex)
240240
{
241-
this.WriteExceptionDetails(ex);
241+
WriteExceptionError(ex);
242242
return;
243243
}
244244
}
@@ -354,7 +354,7 @@ public void NewAzureVMProcess()
354354
throw new Exception(Resources.ServiceDoesNotExistSpecifyLocationOrAffinityGroup);
355355
}
356356

357-
this.WriteExceptionDetails(ex);
357+
WriteExceptionError(ex);
358358
}
359359
}
360360

@@ -549,7 +549,7 @@ protected bool DoesCloudServiceExist(string serviceName)
549549
{
550550
return false;
551551
}
552-
this.WriteExceptionDetails(ex);
552+
WriteExceptionError(ex);
553553
}
554554

555555
return false;

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void NewAzureVMProcess()
200200
if (existingService == null || existingService.Properties == null)
201201
{
202202
// The same service name is already used by another subscription.
203-
this.WriteExceptionDetails(ex);
203+
WriteExceptionError(ex);
204204
return;
205205
}
206206
else if ((string.IsNullOrEmpty(existingService.Properties.Location) &&
@@ -217,13 +217,13 @@ public void NewAzureVMProcess()
217217
// The same service name is already created under the same subscription,
218218
// but its affinity group or location is not matched with the given parameter.
219219
this.WriteWarning("Location or AffinityGroup name is not matched with the existing service");
220-
this.WriteExceptionDetails(ex);
220+
WriteExceptionError(ex);
221221
return;
222222
}
223223
}
224224
else
225225
{
226-
this.WriteExceptionDetails(ex);
226+
WriteExceptionError(ex);
227227
return;
228228
}
229229
}
@@ -335,7 +335,7 @@ public void NewAzureVMProcess()
335335
}
336336
else
337337
{
338-
this.WriteExceptionDetails(ex);
338+
WriteExceptionError(ex);
339339
}
340340

341341
return;

0 commit comments

Comments
 (0)