Skip to content

Commit 6151994

Browse files
address comments.
1 parent 16c7d73 commit 6151994

File tree

2 files changed

+69
-69
lines changed

2 files changed

+69
-69
lines changed

src/ResourceManager/Compute/Commands.Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -118,65 +118,65 @@ public partial class NewAzureRmVmss : ComputeAutomationBaseCmdlet
118118

119119
sealed class Parameters : IParameters<VirtualMachineScaleSet>
120120
{
121-
NewAzureRmVmss _Cmdlet { get; }
121+
NewAzureRmVmss _cmdlet { get; }
122122

123-
Client _Client { get; }
123+
Client _client { get; }
124124

125125
public Parameters(NewAzureRmVmss cmdlet, Client client)
126126
{
127-
_Cmdlet = cmdlet;
128-
_Client = client;
127+
_cmdlet = cmdlet;
128+
_client = client;
129129
}
130130

131131
public string Location
132132
{
133-
get { return _Cmdlet.Location; }
134-
set { _Cmdlet.Location = value; }
133+
get { return _cmdlet.Location; }
134+
set { _cmdlet.Location = value; }
135135
}
136136

137137
public ImageAndOsType ImageAndOsType { get; set; }
138138

139139
public async Task<ResourceConfig<VirtualMachineScaleSet>> CreateConfigAsync()
140140
{
141-
ImageAndOsType = await _Client.UpdateImageAndOsTypeAsync(
142-
ImageAndOsType, _Cmdlet.ImageName, Location);
141+
ImageAndOsType = await _client.UpdateImageAndOsTypeAsync(
142+
ImageAndOsType, _cmdlet.ImageName, Location);
143143

144144
// generate a domain name label if it's not specified.
145-
_Cmdlet.DomainNameLabel = await PublicIPAddressStrategy.UpdateDomainNameLabelAsync(
146-
domainNameLabel: _Cmdlet.DomainNameLabel,
147-
name: _Cmdlet.VMScaleSetName,
145+
_cmdlet.DomainNameLabel = await PublicIPAddressStrategy.UpdateDomainNameLabelAsync(
146+
domainNameLabel: _cmdlet.DomainNameLabel,
147+
name: _cmdlet.VMScaleSetName,
148148
location: Location,
149-
client: _Client);
149+
client: _client);
150150

151-
var resourceGroup = ResourceGroupStrategy.CreateResourceGroupConfig(_Cmdlet.ResourceGroupName);
151+
var resourceGroup = ResourceGroupStrategy.CreateResourceGroupConfig(_cmdlet.ResourceGroupName);
152152

153153
var publicIpAddress = resourceGroup.CreatePublicIPAddressConfig(
154-
name: _Cmdlet.PublicIpAddressName,
155-
domainNameLabel: _Cmdlet.DomainNameLabel,
156-
allocationMethod: _Cmdlet.AllocationMethod);
154+
name: _cmdlet.PublicIpAddressName,
155+
domainNameLabel: _cmdlet.DomainNameLabel,
156+
allocationMethod: _cmdlet.AllocationMethod);
157157

158158
var virtualNetwork = resourceGroup.CreateVirtualNetworkConfig(
159-
name: _Cmdlet.VirtualNetworkName,
160-
addressPrefix: _Cmdlet.VnetAddressPrefix);
159+
name: _cmdlet.VirtualNetworkName,
160+
addressPrefix: _cmdlet.VnetAddressPrefix);
161161

162162
var subnet = virtualNetwork.CreateSubnet(
163-
_Cmdlet.SubnetName, _Cmdlet.SubnetAddressPrefix);
163+
_cmdlet.SubnetName, _cmdlet.SubnetAddressPrefix);
164164

165165
var loadBalancer = resourceGroup.CreateLoadBalancerConfig(
166-
name: _Cmdlet.LoadBalancerName);
166+
name: _cmdlet.LoadBalancerName);
167167

168168
var frontendIpConfiguration = loadBalancer.CreateFrontendIPConfiguration(
169-
name: _Cmdlet.FrontendPoolName,
170-
zones: _Cmdlet.Zone,
169+
name: _cmdlet.FrontendPoolName,
170+
zones: _cmdlet.Zone,
171171
publicIpAddress: publicIpAddress);
172172

173173
var backendAddressPool = loadBalancer.CreateBackendAddressPool(
174-
name: _Cmdlet.BackendPoolName);
174+
name: _cmdlet.BackendPoolName);
175175

176-
if (_Cmdlet.BackendPort != null)
176+
if (_cmdlet.BackendPort != null)
177177
{
178-
var loadBalancingRuleName = _Cmdlet.LoadBalancerName;
179-
foreach (var backendPort in _Cmdlet.BackendPort)
178+
var loadBalancingRuleName = _cmdlet.LoadBalancerName;
179+
foreach (var backendPort in _cmdlet.BackendPort)
180180
{
181181
loadBalancer.CreateLoadBalancingRule(
182182
name: loadBalancingRuleName + backendPort.ToString(),
@@ -187,12 +187,12 @@ public async Task<ResourceConfig<VirtualMachineScaleSet>> CreateConfigAsync()
187187
}
188188
}
189189

190-
_Cmdlet.NatBackendPort = ImageAndOsType.UpdatePorts(_Cmdlet.NatBackendPort);
190+
_cmdlet.NatBackendPort = ImageAndOsType.UpdatePorts(_cmdlet.NatBackendPort);
191191

192-
var inboundNatPoolName = _Cmdlet.VMScaleSetName;
193-
var PortRangeSize = _Cmdlet.InstanceCount * 2;
192+
var inboundNatPoolName = _cmdlet.VMScaleSetName;
193+
var PortRangeSize = _cmdlet.InstanceCount * 2;
194194

195-
var inboundNatPools = _Cmdlet.NatBackendPort
195+
var inboundNatPools = _cmdlet.NatBackendPort
196196
?.Select((port, i) =>
197197
{
198198
var portRangeStart = FirstPortRangeStart + i * 2000;
@@ -206,18 +206,18 @@ public async Task<ResourceConfig<VirtualMachineScaleSet>> CreateConfigAsync()
206206
.ToList();
207207

208208
return resourceGroup.CreateVirtualMachineScaleSetConfig(
209-
name: _Cmdlet.VMScaleSetName,
209+
name: _cmdlet.VMScaleSetName,
210210
subnet: subnet,
211211
frontendIpConfigurations: new[] { frontendIpConfiguration },
212212
backendAdressPool: backendAddressPool,
213213
inboundNatPools: inboundNatPools,
214214
imageAndOsType: ImageAndOsType,
215-
adminUsername: _Cmdlet.Credential.UserName,
216-
adminPassword: new NetworkCredential(string.Empty, _Cmdlet.Credential.Password).Password,
217-
vmSize: _Cmdlet.VmSize,
218-
instanceCount: _Cmdlet.InstanceCount,
219-
upgradeMode: _Cmdlet.MyInvocation.BoundParameters.ContainsKey(nameof(UpgradePolicyMode))
220-
? _Cmdlet.UpgradePolicyMode
215+
adminUsername: _cmdlet.Credential.UserName,
216+
adminPassword: new NetworkCredential(string.Empty, _cmdlet.Credential.Password).Password,
217+
vmSize: _cmdlet.VmSize,
218+
instanceCount: _cmdlet.InstanceCount,
219+
upgradeMode: _cmdlet.MyInvocation.BoundParameters.ContainsKey(nameof(UpgradePolicyMode))
220+
? _cmdlet.UpgradePolicyMode
221221
: (UpgradeMode?)null);
222222
}
223223
}

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation/NewAzureVMCommand.cs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -229,84 +229,84 @@ public override void ExecuteCmdlet()
229229

230230
class Parameters : IParameters<VirtualMachine>
231231
{
232-
NewAzureVMCommand _Cmdlet { get; }
232+
NewAzureVMCommand _cmdlet { get; }
233233

234-
Client _Client { get; }
234+
Client _client { get; }
235235

236236
public Parameters(NewAzureVMCommand cmdlet, Client client)
237237
{
238-
_Cmdlet = cmdlet;
239-
_Client = client;
238+
_cmdlet = cmdlet;
239+
_client = client;
240240
}
241241

242242
public ImageAndOsType ImageAndOsType { get; set; }
243243

244244
public string Location
245245
{
246-
get { return _Cmdlet.Location; }
247-
set { _Cmdlet.Location = value; }
246+
get { return _cmdlet.Location; }
247+
set { _cmdlet.Location = value; }
248248
}
249249

250250
public BlobUri DestinationUri;
251251

252252
public async Task<ResourceConfig<VirtualMachine>> CreateConfigAsync()
253253
{
254-
if (_Cmdlet.DiskFile == null)
254+
if (_cmdlet.DiskFile == null)
255255
{
256-
ImageAndOsType = await _Client.UpdateImageAndOsTypeAsync(
257-
ImageAndOsType, _Cmdlet.ImageName, Location);
256+
ImageAndOsType = await _client.UpdateImageAndOsTypeAsync(
257+
ImageAndOsType, _cmdlet.ImageName, Location);
258258
}
259259

260-
_Cmdlet.DomainNameLabel = await PublicIPAddressStrategy.UpdateDomainNameLabelAsync(
261-
domainNameLabel: _Cmdlet.DomainNameLabel,
262-
name: _Cmdlet.Name,
260+
_cmdlet.DomainNameLabel = await PublicIPAddressStrategy.UpdateDomainNameLabelAsync(
261+
domainNameLabel: _cmdlet.DomainNameLabel,
262+
name: _cmdlet.Name,
263263
location: Location,
264-
client: _Client);
264+
client: _client);
265265

266-
var resourceGroup = ResourceGroupStrategy.CreateResourceGroupConfig(_Cmdlet.ResourceGroupName);
266+
var resourceGroup = ResourceGroupStrategy.CreateResourceGroupConfig(_cmdlet.ResourceGroupName);
267267
var virtualNetwork = resourceGroup.CreateVirtualNetworkConfig(
268-
name: _Cmdlet.VirtualNetworkName, addressPrefix: _Cmdlet.AddressPrefix);
269-
var subnet = virtualNetwork.CreateSubnet(_Cmdlet.SubnetName, _Cmdlet.SubnetAddressPrefix);
268+
name: _cmdlet.VirtualNetworkName, addressPrefix: _cmdlet.AddressPrefix);
269+
var subnet = virtualNetwork.CreateSubnet(_cmdlet.SubnetName, _cmdlet.SubnetAddressPrefix);
270270
var publicIpAddress = resourceGroup.CreatePublicIPAddressConfig(
271-
name: _Cmdlet.PublicIpAddressName,
272-
domainNameLabel: _Cmdlet.DomainNameLabel,
273-
allocationMethod: _Cmdlet.AllocationMethod);
271+
name: _cmdlet.PublicIpAddressName,
272+
domainNameLabel: _cmdlet.DomainNameLabel,
273+
allocationMethod: _cmdlet.AllocationMethod);
274274
var networkSecurityGroup = resourceGroup.CreateNetworkSecurityGroupConfig(
275-
name: _Cmdlet.SecurityGroupName,
276-
openPorts: _Cmdlet.OpenPorts,
275+
name: _cmdlet.SecurityGroupName,
276+
openPorts: _cmdlet.OpenPorts,
277277
imageAndOsType: ImageAndOsType);
278278

279279
var networkInterface = resourceGroup.CreateNetworkInterfaceConfig(
280-
_Cmdlet.Name, subnet, publicIpAddress, networkSecurityGroup);
280+
_cmdlet.Name, subnet, publicIpAddress, networkSecurityGroup);
281281

282-
var availabilitySet = _Cmdlet.AvailabilitySetName == null
282+
var availabilitySet = _cmdlet.AvailabilitySetName == null
283283
? null
284-
: resourceGroup.CreateAvailabilitySetConfig(name: _Cmdlet.AvailabilitySetName);
284+
: resourceGroup.CreateAvailabilitySetConfig(name: _cmdlet.AvailabilitySetName);
285285

286-
if (_Cmdlet.DiskFile == null)
286+
if (_cmdlet.DiskFile == null)
287287
{
288288
return resourceGroup.CreateVirtualMachineConfig(
289-
name: _Cmdlet.Name,
289+
name: _cmdlet.Name,
290290
networkInterface: networkInterface,
291291
imageAndOsType: ImageAndOsType,
292-
adminUsername: _Cmdlet.Credential.UserName,
292+
adminUsername: _cmdlet.Credential.UserName,
293293
adminPassword:
294-
new NetworkCredential(string.Empty, _Cmdlet.Credential.Password).Password,
295-
size: _Cmdlet.Size,
294+
new NetworkCredential(string.Empty, _cmdlet.Credential.Password).Password,
295+
size: _cmdlet.Size,
296296
availabilitySet: availabilitySet);
297297
}
298298
else
299299
{
300300
var disk = resourceGroup.CreateManagedDiskConfig(
301-
name: _Cmdlet.Name,
301+
name: _cmdlet.Name,
302302
sourceUri: DestinationUri.Uri.ToString());
303303

304304
return resourceGroup.CreateVirtualMachineConfig(
305-
name: _Cmdlet.Name,
305+
name: _cmdlet.Name,
306306
networkInterface: networkInterface,
307307
osType: ImageAndOsType.OsType,
308308
disk: disk,
309-
size: _Cmdlet.Size,
309+
size: _cmdlet.Size,
310310
availabilitySet: availabilitySet);
311311
}
312312
}

0 commit comments

Comments
 (0)