Skip to content

Commit a92260f

Browse files
committed
Bug fix: allow rename of entities
1 parent b21f8c6 commit a92260f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/ServiceConfig/SetAzureStorSimpleAccessControlRecord.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public override void ExecuteCmdlet()
7171
GlobalId = existingAcr.GlobalId,
7272
InitiatorName = IQNInitiatorName,
7373
InstanceId = existingAcr.InstanceId,
74-
Name = (NewName != null ? NewName : existingAcr.Name),
74+
Name = (!string.IsNullOrWhiteSpace(NewName) ? NewName : existingAcr.Name),
7575
VolumeCount = existingAcr.VolumeCount
7676
},
7777
}

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Volume/SetAzureStorSimpleDeviceVolume.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,17 @@ public override void ExecuteCmdlet()
9494
{
9595
diskDetails.AcrList = AccessControlRecords;
9696
}
97-
if (NewName != null)
97+
98+
if (!string.IsNullOrWhiteSpace(NewName))
9899
{
99-
diskDetails.Name = VolumeName = NewName;
100+
diskDetails.Name = NewName;
100101
}
101102

102103
if (WaitForComplete.IsPresent)
103104
{
104105
var taskstatus = StorSimpleClient.UpdateVolume(deviceId, diskDetails.InstanceId, diskDetails);
105106
HandleSyncTaskResponse(taskstatus, "update");
106-
var updatedVolume = StorSimpleClient.GetVolumeByName(deviceId, VolumeName);
107+
var updatedVolume = StorSimpleClient.GetVolumeByName(deviceId, diskDetails.Name);
107108
WriteObject(updatedVolume.VirtualDiskInfo);
108109
}
109110
else

src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletHelpMessage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.WindowsAzure.Commands.StorSimple
1818
internal static class StorSimpleCmdletHelpMessage
1919
{
2020
public const string ACRName = "The access control record name.";
21-
public const string ACRNewName = "The new name desired for the access control record";
21+
public const string ACRNewName = "The new name for the access control record";
2222
public const string ACRObject = "The access control record object.";
2323
public const string DataContainerBandwidth = "The data container bandwidth rate.";
2424
public const string DataContainerEncryptionEnabled = "Flag to encrypt the data container.";
@@ -47,7 +47,7 @@ internal static class StorSimpleCmdletHelpMessage
4747
public const string VolumeName = "The volume name.";
4848
public const string VolumeOnline = "Is the volume online";
4949
public const string VolumeSize = "The size of volume in bytes.";
50-
public const string VolumeNewName = "The new name desired for the volume";
50+
public const string VolumeNewName = "The new name for the volume";
5151
public const string WaitTillComplete = "Wait till the async operation completes.";
5252
public const string BackupPolicyName = "Name of the Backup policy that you wish to retrieve. Skip this parameter to get all policies";
5353
public const string BackupIdToDelete = "InstanceId of the Backup that needs to be deleted";
@@ -80,7 +80,7 @@ internal static class StorSimpleCmdletHelpMessage
8080
public const string BackupScheduleBaseObjsToAdd = "List of BackupScheduleBase objects to be added to the policy";
8181
public const string BackupScheduleBaseObjsToUpdate = "List of BackupScheduleUpdateRequest objects to be updated";
8282
public const string BackupScheduleBaseObjsToDelete = "List of Instance Id of BackupSchedule objects to be deleted";
83-
public const string BackupPolicyNewName = "The new name desired for the backup policy";
83+
public const string BackupPolicyNewName = "The new name for the backup policy";
8484
public const string VolumeObjsToUpdate = "List of VolumeIds to be updated";
8585
public const string ResourceName = "Name of the resource which needs to be retrieved";
8686
public const string SourceDeviceId = "The device identifier of the source device";

0 commit comments

Comments
 (0)