Skip to content

Commit d860931

Browse files
committed
Merge pull request #28 from AzCiS/bugfix-2074697
Fix bug 2074697 - Set-ASSDevice silently terminates when no optional par...
2 parents 6acc061 + 7262852 commit d860931

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ public override void ExecuteCmdlet()
135135

136136
private bool ProcessParameters()
137137
{
138+
// Make sure that atleast one of the settings has been provided.
139+
// Its no use making a request when the user didnt specify any of
140+
// the settings.
141+
if (string.IsNullOrEmpty(NewName) && TimeZone == null &&
142+
string.IsNullOrEmpty(SecondaryDnsServer) &&
143+
(StorSimpleNetworkConfig == null || StorSimpleNetworkConfig.Count() < 1))
144+
{
145+
throw new ArgumentException(Resources.SetAzureStorSimpleDeviceNoSettingsProvided);
146+
}
147+
138148
// Make sure that the DeviceId property has the appropriate value irrespective of the parameter set
139149
if (ParameterSetName == StorSimpleCmdletParameterSet.IdentifyByName)
140150
{

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,4 +513,7 @@
513513
<data name="CIKInvalidWithException" xml:space="preserve">
514514
<value>Invalid value for Registration Key. CIK provided couldnt be used to decrypt the secrets! The exact exception while decrypting is "{0}"!</value>
515515
</data>
516+
<data name="SetAzureStorSimpleDeviceNoSettingsProvided" xml:space="preserve">
517+
<value>No settings were provided for updating device details.</value>
518+
</data>
516519
</root>

0 commit comments

Comments
 (0)