Skip to content

Commit e4f8985

Browse files
committed
Remove the NewName parameter
1 parent 40a6423 commit e4f8985

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleVirtualDevice.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,18 @@ public class SetAzureStorSimpleVirtualDevice : StorSimpleCmdletBase
3838
[Parameter(Mandatory = true, Position = 0, HelpMessage = StorSimpleCmdletHelpMessage.DeviceName)]
3939
[ValidateNotNullOrEmpty]
4040
public string DeviceName { get; set; }
41-
42-
/// <summary>
43-
/// New friendly name for the device.
44-
/// </summary>
45-
[Parameter(Mandatory=false, Position = 1, HelpMessage = StorSimpleCmdletHelpMessage.NewDeviceName)]
46-
[ValidateNotNullOrEmpty]
47-
public string NewName { get; set; }
4841

4942
/// <summary>
5043
/// TimeZone for the device.
5144
/// </summary>
52-
[Parameter(Mandatory = false, Position = 2, HelpMessage = StorSimpleCmdletHelpMessage.TimeZone, ValueFromPipeline=true)]
45+
[Parameter(Mandatory = false, Position = 1, HelpMessage = StorSimpleCmdletHelpMessage.TimeZone, ValueFromPipeline=true)]
5346
[ValidateNotNullOrEmpty]
5447
public TimeZoneInfo TimeZone { get; set; }
5548

5649
/// <summary>
5750
/// Service Encryption Key for the resource.
5851
/// </summary>
59-
[Parameter(Mandatory=true, Position = 3, HelpMessage = StorSimpleCmdletHelpMessage.SEK)]
52+
[Parameter(Mandatory=true, Position = 2, HelpMessage = StorSimpleCmdletHelpMessage.SEK)]
6053
[ValidateNotNullOrEmpty]
6154
public string SecretKey { get; set; }
6255

@@ -80,7 +73,7 @@ public override void ExecuteCmdlet()
8073
string cik = EncryptionCmdLetHelper.RetrieveCIK(this, StorSimpleContext.ResourceId);
8174

8275
// Update device details.
83-
StorSimpleClient.UpdateVirtualDeviceDetails(deviceDetails, NewName, TimeZone, SecretKey, cik);
76+
StorSimpleClient.UpdateVirtualDeviceDetails(deviceDetails, TimeZone, SecretKey, cik);
8477

8578
// Make request with updated data
8679
WriteVerbose(string.Format(Resources.BeginningDeviceConfiguration, deviceDetails.DeviceProperties.FriendlyName));

src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleDevicesClient.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,8 @@ private void UpdateDeviceDetailsObject(DeviceDetails deviceDetails, string newNa
202202
deviceDetails.WebProxy = null;
203203
}
204204

205-
public void UpdateVirtualDeviceDetails(DeviceDetails details, string newName, TimeZoneInfo timeZone, string sek, string cik)
205+
public void UpdateVirtualDeviceDetails(DeviceDetails details, TimeZoneInfo timeZone, string sek, string cik)
206206
{
207-
if (newName != null)
208-
{
209-
details.DeviceProperties.FriendlyName = newName;
210-
}
211207
if (timeZone != null)
212208
{
213209
details.TimeServer.TimeZone = timeZone.StandardName;
@@ -226,6 +222,7 @@ public void UpdateVirtualDeviceDetails(DeviceDetails details, string newName, Ti
226222

227223
// mark everything that we dont intend to modify as null - indicating
228224
// to the service that there has been no change
225+
details.DeviceProperties = null;
229226
details.AlertNotification = null;
230227
details.Chap = null;
231228
details.DnsServer = null;

0 commit comments

Comments
 (0)