Skip to content

Commit ac32b72

Browse files
committed
Fix changes suggested in PR
1 parent 8fd85eb commit ac32b72

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public class NewAzureStorSimpleNetworkConfig : StorSimpleCmdletBase
109109
private IPAddress ipv4Gateway;
110110
private IPAddress ipv4Netmask;
111111
private IPAddress ipv6Gateway;
112+
NetInterfaceId interfaceAlias;
112113

113114
public override void ExecuteCmdlet()
114115
{
@@ -130,7 +131,7 @@ public override void ExecuteCmdlet()
130131
IPv4Address = ipv4Address,
131132
IPv6Prefix = IPv6Prefix,
132133
IPv4Netmask = ipv4Netmask,
133-
InterfaceAlias = (NetInterfaceId)Enum.Parse(typeof(NetInterfaceId), InterfaceAlias)
134+
InterfaceAlias = interfaceAlias
134135
};
135136

136137
WriteObject(netConfig);
@@ -144,6 +145,14 @@ public override void ExecuteCmdlet()
144145
}
145146

146147
private bool ProcessParameters(){
148+
// parse interfaceAlias
149+
if (!Enum.TryParse<NetInterfaceId>(InterfaceAlias, out interfaceAlias))
150+
{
151+
WriteVerbose(string.Format(Resources.InvalidInterfaceId, InterfaceAlias));
152+
return false;
153+
}
154+
155+
// Try and set all the IP address
147156
if (!TrySetIPAddress(Controller0IPv4Address, out controller0Address, "Controller0IPv4Address"))
148157
{
149158
return false;

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceJobs/GetAzureStorSimpleJob.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class GetAzureStorSimpleJob : StorSimpleCmdletBase
4444
/// <summary>
4545
/// InstanceId/JobId of the job to retrieve
4646
/// </summary>
47-
[Parameter(Position = 0, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById,
47+
[Parameter(Mandatory=true, Position = 0, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById,
4848
HelpMessage = StorSimpleCmdletHelpMessage.DeviceJobId)]
4949
public string JobId { get; set; }
5050

@@ -160,8 +160,7 @@ private bool ProcessParameters()
160160

161161
Skip = Skip ?? 0;
162162

163-
// Need to use xml convert because we want ISO 8601 formatting to avoid deserialization
164-
// probs in the backend.
163+
// Need to use xml convert because we want ISO 8601 formatting - which is a mandatory requirement from the backend.
165164
fromDateTimeIsoString = From.HasValue ? XmlConvert.ToString(From.Value) : null;
166165

167166
toDateTimeIsoString = To.HasValue ? XmlConvert.ToString(To.Value) : null;

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceJobs/StopAzureStorSimpleJob.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class StopAzureStorSimpleJob : StorSimpleCmdletBase
3232
/// <summary>
3333
/// Device job id of the job to stop.
3434
/// </summary>
35-
[Parameter(Mandatory = true, Position = 0, ParameterSetName = StorSimpleCmdletParameterSet.IdentifyById, HelpMessage = StorSimpleCmdletHelpMessage.DeviceJobId)]
35+
[Parameter(Mandatory = true, Position = 0, HelpMessage = StorSimpleCmdletHelpMessage.DeviceJobId)]
3636
[ValidateNotNullOrEmptyAttribute]
3737
public string JobId { get; set; }
3838

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
@@ -498,4 +498,7 @@
498498
<data name="StartASSBackupCloneJobWarningMessage" xml:space="preserve">
499499
<value>Are you sure you want to clone the backup with backupId {0}?</value>
500500
</data>
501+
<data name="InvalidInterfaceId" xml:space="preserve">
502+
<value>{0} is not a valid InterfaceAlias!</value>
503+
</data>
501504
</root>

0 commit comments

Comments
 (0)