Skip to content

Commit db4b58e

Browse files
committed
Revert "Revert "Revert "Added check to ensure volume container creation is allowed only if mandatory config has been done"""
This reverts commit 37067c1.
1 parent ff05f4e commit db4b58e

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DataContainer/NewAzureStorSimpleDeviceVolumeContainer.cs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,12 @@ public override void ExecuteCmdlet()
6060
string deviceid = StorSimpleClient.GetDeviceId(DeviceName);
6161
if (deviceid == null)
6262
{
63-
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
63+
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
64+
WriteObject(null);
65+
return;
6466
}
6567

66-
// Get the current device details.
67-
var deviceDetails = StorSimpleClient.GetDeviceDetails(deviceid);
68-
if (deviceDetails == null || deviceDetails.DeviceProperties == null)
69-
{
70-
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
71-
}
72-
73-
// If the device has not yet been configured with the mandatory params, then don't allow the volume-container creation
74-
// TBD : This check should ideally be in the service code, but is being put here as we want to avoud a major change
75-
// to the service so late in the current release cycle. Once this fix has been migrated to the service, this check can be removed from here
76-
if (!deviceDetails.DeviceProperties.IsConfigUpdated)
77-
{
78-
throw new ArgumentException(Resources.DeviceNotConfiguredMessage);
79-
}
80-
81-
if (EncryptionEnabled == true && (string.IsNullOrEmpty(EncryptionKey) || !IsValidAsciiString(EncryptionKey)))
68+
if(EncryptionEnabled == true && (string.IsNullOrEmpty(EncryptionKey) || !IsValidAsciiString(EncryptionKey)))
8269
{
8370
throw new ArgumentException(Resources.EncryptionKeyNotAcceptableMessage);
8471
}

0 commit comments

Comments
 (0)