@@ -118,116 +118,6 @@ protected virtual void PostInvoke(IExecutionContext executionContext)
118
118
PopulateReservationSecurityGroupNames ( rir . Reservation ) ;
119
119
return ;
120
120
}
121
-
122
- // In case of DescribeSecurityGroupsResponse type, the Ipv4Ranges values for each of the retured IpPermissions is unmarshalled
123
- // and the extracted Cidr values is set on the IpRanges property of IpPermission. If the customer is using IpRanges, then they will not be broken.
124
- var describeSecurityGroupsResponse = response as DescribeSecurityGroupsResponse ;
125
- if ( describeSecurityGroupsResponse != null )
126
- {
127
- if ( describeSecurityGroupsResponse . IsSetSecurityGroups ( ) )
128
- {
129
- foreach ( var securityGroup in describeSecurityGroupsResponse . SecurityGroups )
130
- {
131
- if ( securityGroup . IsSetIpPermissions ( ) )
132
- {
133
- SetIpRangesProperty ( securityGroup . IpPermissions ) ;
134
- }
135
- else if ( securityGroup . IsSetIpPermissionsEgress ( ) )
136
- {
137
- SetIpRangesProperty ( securityGroup . IpPermissionsEgress ) ;
138
- }
139
- }
140
- }
141
- return ;
142
- }
143
-
144
- var authorizeSecurityGroupEgressRequest = request as AuthorizeSecurityGroupEgressRequest ;
145
- if ( authorizeSecurityGroupEgressRequest != null )
146
- if ( authorizeSecurityGroupEgressRequest . IsSetIpPermissions ( ) )
147
- {
148
- RestoreRequestIpPermissions ( authorizeSecurityGroupEgressRequest . IpPermissions ) ;
149
- return ;
150
- }
151
-
152
- var authorizeSecurityGroupIngressRequest = request as AuthorizeSecurityGroupIngressRequest ;
153
- if ( authorizeSecurityGroupIngressRequest != null )
154
- if ( authorizeSecurityGroupIngressRequest . IsSetIpPermissions ( ) )
155
- {
156
- RestoreRequestIpPermissions ( authorizeSecurityGroupIngressRequest . IpPermissions ) ;
157
- return ;
158
- }
159
-
160
-
161
- var revokeSecurityGroupEgressRequest = request as RevokeSecurityGroupEgressRequest ;
162
- if ( revokeSecurityGroupEgressRequest != null )
163
- if ( revokeSecurityGroupEgressRequest . IsSetIpPermissions ( ) )
164
- {
165
- RestoreRequestIpPermissions ( revokeSecurityGroupEgressRequest . IpPermissions ) ;
166
- return ;
167
- }
168
-
169
-
170
- var revokeSecurityGroupIngressRequest = request as RevokeSecurityGroupIngressRequest ;
171
- if ( revokeSecurityGroupIngressRequest != null )
172
- if ( revokeSecurityGroupIngressRequest . IsSetIpPermissions ( ) )
173
- {
174
- RestoreRequestIpPermissions ( revokeSecurityGroupIngressRequest . IpPermissions ) ;
175
- return ;
176
- }
177
-
178
-
179
- var updateSecurityGroupRuleDescriptionsEgressRequest = request as UpdateSecurityGroupRuleDescriptionsEgressRequest ;
180
- if ( updateSecurityGroupRuleDescriptionsEgressRequest != null )
181
- if ( updateSecurityGroupRuleDescriptionsEgressRequest . IsSetIpPermissions ( ) )
182
- {
183
- RestoreRequestIpPermissions ( updateSecurityGroupRuleDescriptionsEgressRequest . IpPermissions ) ;
184
- return ;
185
- }
186
-
187
-
188
- var updateSecurityGroupRuleDescriptionsIngressRequest = request as UpdateSecurityGroupRuleDescriptionsIngressRequest ;
189
- if ( updateSecurityGroupRuleDescriptionsIngressRequest != null )
190
- if ( updateSecurityGroupRuleDescriptionsIngressRequest . IsSetIpPermissions ( ) )
191
- {
192
- RestoreRequestIpPermissions ( updateSecurityGroupRuleDescriptionsIngressRequest . IpPermissions ) ;
193
- return ;
194
- }
195
-
196
- }
197
-
198
- /// <summary>
199
- /// Cidr values from Ipv4Ranges is extracted and set on IpRanges.
200
- /// The internal dictionary collection is also set to the Ipv4Range values.
201
- /// </summary>
202
- /// <param name="ipPermissions"></param>
203
- private static void SetIpRangesProperty ( List < IpPermission > ipPermissions )
204
- {
205
- foreach ( var ipPermission in ipPermissions )
206
- {
207
- if ( ipPermission . Ipv4Ranges == null )
208
- {
209
- continue ;
210
- }
211
-
212
- ipPermission . CopyIpv4RangesToInternalCollection ( ipPermission . Ipv4Ranges ) ;
213
- }
214
- }
215
-
216
- /// <summary>
217
- /// The original values used by the customer in the Ipv4Ranges property on the request
218
- /// object is restored. This is done when the customer is using the deprecated IpRanges property.
219
- /// </summary>
220
- /// <param name="IpPermissions"></param>
221
- private static void RestoreRequestIpPermissions ( List < IpPermission > IpPermissions )
222
- {
223
- foreach ( var ipPermission in IpPermissions )
224
- {
225
- if ( ipPermission . RestoreOldIpV4Range )
226
- {
227
- ipPermission . Ipv4Ranges = ipPermission . PreIpv4Ranges ;
228
- ipPermission . RestoreOldIpV4Range = false ;
229
- }
230
- }
231
121
}
232
122
233
123
private static void PopulateLaunchSpecificationSecurityGroupNames ( LaunchSpecification launchSpecification )
0 commit comments