@@ -9,12 +9,18 @@ def __init__(self, nsxt_profile_attributes):
99 """
1010 self .ap_http_supported_attributes = nsxt_profile_attributes ['Application_Http_Profile_supported_attr' ]
1111 self .common_na_attr = nsxt_profile_attributes ['Common_Na_List' ]
12+ self .np_supported_attributes = nsxt_profile_attributes ['Network_Profile_supported_attr' ]
13+
14+
1215
1316
1417 def convert (self , alb_config , nsx_lb_config , prefix ):
1518 alb_config ['ApplicationProfile' ] = list ()
1619 alb_config ['NetworkProfile' ] = list ()
17-
20+ skipped_ap = []
21+ skipped_np = []
22+ attr_ap = []
23+ attr_np = []
1824 for lb_pr in nsx_lb_config ['LbAppProfiles' ]:
1925 name = lb_pr .get ('display_name' )
2026 if prefix :
@@ -38,21 +44,53 @@ def convert(self, alb_config, nsx_lb_config, prefix):
3844 u_ignore = []
3945 ignore_for_defaults = {}
4046
47+
4148 if lb_pr ['resource_type' ] == 'LBHttpProfile' :
4249 skipped = [val for val in lb_pr .keys ()
4350 if val not in self .ap_http_supported_attributes ]
4451 if lb_pr .get ("description" ):
4552 alb_pr ["description" ] = lb_pr ['description' ]
4653
4754 alb_config ['ApplicationProfile' ].append (alb_pr )
55+ skipped_ap .append (skipped )
56+
57+ val = dict (
58+ name = alb_pr ['name' ],
59+ resource_type = lb_pr ['resource_type' ],
60+ alb_pr = alb_pr )
61+ attr_ap .append (val )
4862
49- conv_status = conv_utils .get_conv_status (
50- skipped , indirect , ignore_for_defaults , nsx_lb_config ['LbAppProfiles' ],
51- u_ignore , na_list )
52- conv_utils .add_conv_status ('ApplicationHttpProfile' , lb_pr ['resource_type' ], alb_pr ['name' ], conv_status ,
53- [{'application_http_profile' : alb_pr }])
5463 else :
64+ skipped = [val for val in lb_pr .keys ()
65+ if val not in self .np_supported_attributes ]
66+
5567 alb_config ['NetworkProfile' ].append (alb_pr )
68+ skipped_np .append (skipped )
69+ val = dict (
70+ name = alb_pr ['name' ],
71+ resource_type = lb_pr ['resource_type' ],
72+ alb_pr = alb_pr )
73+ attr_np .append (val )
74+
75+ if len (skipped_ap ):
76+ c = 0
77+ for skipped in skipped_ap :
78+ conv_status = conv_utils .get_conv_status (
79+ skipped , indirect , ignore_for_defaults , nsx_lb_config ['LbAppProfiles' ],
80+ u_ignore , na_list )
81+ conv_utils .add_conv_status ('ApplicationHttpProfile' ,attr_ap [c ]['resource_type' ] , attr_ap [c ]['name' ], conv_status ,
82+ [{'application_http_profile' : attr_ap [c ]['alb_pr' ]}])
83+ c = c + 1
84+
85+ if len (skipped_np ):
86+ c = 0
87+ for skipped in skipped_np :
88+ conv_status = conv_utils .get_conv_status (
89+ skipped , indirect , ignore_for_defaults , nsx_lb_config ['LbAppProfiles' ],
90+ u_ignore , na_list )
91+ conv_utils .add_conv_status ('NetworkProfile' , attr_np [c ]['resource_type' ],attr_np [c ]['name' ], conv_status ,
92+ [{'network_profile' : attr_np [c ]['alb_pr' ]}])
93+ c = c + 1
5694
5795
5896 def convert_http (self ,alb_pr ,lb_pr ):
0 commit comments