File tree Expand file tree Collapse file tree 4 files changed +43
-26
lines changed Expand file tree Collapse file tree 4 files changed +43
-26
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ public override void Execute()
247
247
}
248
248
}
249
249
250
- List < string > resourceIds = new List < string > ( ) ;
250
+ List < string > resourceIdsRequiringAuthToken = new List < string > ( ) ;
251
251
Dictionary < string , List < string > > auxAuthHeader = null ;
252
252
253
253
// Get aux token for each gateway lb references
@@ -256,15 +256,20 @@ public override void Execute()
256
256
if ( frontend . GatewayLoadBalancer != null )
257
257
{
258
258
//Get the aux header for the remote vnet
259
- resourceIds . Add ( frontend . GatewayLoadBalancer . Id ) ;
260
- var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
261
- if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
262
- {
263
- auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
264
- }
259
+ resourceIdsRequiringAuthToken . Add ( frontend . GatewayLoadBalancer . Id ) ;
260
+ }
261
+ }
262
+
263
+ if ( resourceIdsRequiringAuthToken . Count > 0 )
264
+ {
265
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIdsRequiringAuthToken ) ;
266
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
267
+ {
268
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
265
269
}
266
270
}
267
271
272
+
268
273
ConfirmAction (
269
274
Force . IsPresent ,
270
275
string . Format ( Properties . Resources . OverwritingResource , Name ) ,
Original file line number Diff line number Diff line change @@ -138,11 +138,15 @@ public override void Execute()
138
138
{
139
139
//Get the aux header for the remote vnet
140
140
resourceIds . Add ( frontend . GatewayLoadBalancer . Id ) ;
141
- var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
142
- if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
143
- {
144
- auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
145
- }
141
+ }
142
+ }
143
+
144
+ if ( resourceIds . Count > 0 )
145
+ {
146
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
147
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
148
+ {
149
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
146
150
}
147
151
}
148
152
Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ private PSNetworkInterface CreateNetworkInterface()
437
437
networkInterface . NetworkSecurityGroup . Id = this . NetworkSecurityGroupId ;
438
438
}
439
439
440
- List < string > resourceIds = new List < string > ( ) ;
440
+ List < string > resourceIdsRequiringAuthToken = new List < string > ( ) ;
441
441
Dictionary < string , List < string > > auxAuthHeader = null ;
442
442
443
443
// Get aux token for each gateway lb references
@@ -446,12 +446,16 @@ private PSNetworkInterface CreateNetworkInterface()
446
446
if ( ipConfiguration . GatewayLoadBalancer != null )
447
447
{
448
448
//Get the aux header for the remote vnet
449
- resourceIds . Add ( ipConfiguration . GatewayLoadBalancer . Id ) ;
450
- var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
451
- if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
452
- {
453
- auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
454
- }
449
+ resourceIdsRequiringAuthToken . Add ( ipConfiguration . GatewayLoadBalancer . Id ) ;
450
+ }
451
+ }
452
+
453
+ if ( resourceIdsRequiringAuthToken . Count > 0 )
454
+ {
455
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIdsRequiringAuthToken ) ;
456
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
457
+ {
458
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
455
459
}
456
460
}
457
461
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public override void Execute()
44
44
throw new ArgumentException ( Microsoft . Azure . Commands . Network . Properties . Resources . ResourceNotFound ) ;
45
45
}
46
46
47
- List < string > resourceIds = new List < string > ( ) ;
47
+ List < string > resourceIdsRequiringAuthToken = new List < string > ( ) ;
48
48
Dictionary < string , List < string > > auxAuthHeader = null ;
49
49
50
50
foreach ( var ipconfig in NetworkInterface . IpConfigurations )
@@ -59,12 +59,16 @@ public override void Execute()
59
59
if ( ipconfig . GatewayLoadBalancer != null )
60
60
{
61
61
//Get the aux header for the remote vnet
62
- resourceIds . Add ( ipconfig . GatewayLoadBalancer . Id ) ;
63
- var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIds ) ;
64
- if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
65
- {
66
- auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
67
- }
62
+ resourceIdsRequiringAuthToken . Add ( ipconfig . GatewayLoadBalancer . Id ) ;
63
+ }
64
+ }
65
+
66
+ if ( resourceIdsRequiringAuthToken . Count > 0 )
67
+ {
68
+ var auxHeaderDictionary = GetAuxilaryAuthHeaderFromResourceIds ( resourceIdsRequiringAuthToken ) ;
69
+ if ( auxHeaderDictionary != null && auxHeaderDictionary . Count > 0 )
70
+ {
71
+ auxAuthHeader = new Dictionary < string , List < string > > ( auxHeaderDictionary ) ;
68
72
}
69
73
}
70
74
You can’t perform that action at this time.
0 commit comments