Skip to content

Commit

Permalink
Revert "Revert "Revert "Added check to ensure volume container creati…
Browse files Browse the repository at this point in the history
…on is allowed only if mandatory config has been done"""

This reverts commit 37067c1.
  • Loading branch information
Sumanth-SK committed Apr 9, 2015
1 parent ff05f4e commit db4b58e
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,12 @@ public override void ExecuteCmdlet()
string deviceid = StorSimpleClient.GetDeviceId(DeviceName);
if (deviceid == null)
{
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
WriteVerbose(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
WriteObject(null);
return;
}

// Get the current device details.
var deviceDetails = StorSimpleClient.GetDeviceDetails(deviceid);
if (deviceDetails == null || deviceDetails.DeviceProperties == null)
{
throw new ArgumentException(string.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, DeviceName));
}

// If the device has not yet been configured with the mandatory params, then don't allow the volume-container creation
// TBD : This check should ideally be in the service code, but is being put here as we want to avoud a major change
// 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
if (!deviceDetails.DeviceProperties.IsConfigUpdated)
{
throw new ArgumentException(Resources.DeviceNotConfiguredMessage);
}

if (EncryptionEnabled == true && (string.IsNullOrEmpty(EncryptionKey) || !IsValidAsciiString(EncryptionKey)))
if(EncryptionEnabled == true && (string.IsNullOrEmpty(EncryptionKey) || !IsValidAsciiString(EncryptionKey)))
{
throw new ArgumentException(Resources.EncryptionKeyNotAcceptableMessage);
}
Expand Down

0 comments on commit db4b58e

Please sign in to comment.