@@ -75,10 +75,10 @@ def take_action(self, parsed_args):
7575 body .update (
7676 arg2body (bgpvpn ['id' ], parsed_args ))
7777
78- if self ._assoc_res_name == constants .NETWORK_ASSOC :
78+ if self ._resource == constants .NETWORK_ASSOC :
7979 obj = client .create_bgpvpn_network_association (
8080 bgpvpn ['id' ], ** body )
81- elif self ._assoc_res_name == constants .PORT_ASSOCS :
81+ elif self ._resource == constants .PORT_ASSOC :
8282 obj = client .create_bgpvpn_port_association (bgpvpn ['id' ], ** body )
8383 else :
8484 obj = client .create_bgpvpn_router_association (
@@ -123,10 +123,10 @@ def take_action(self, parsed_args):
123123 arg2body = getattr (self , '_args2body' , None )
124124 if callable (arg2body ):
125125 body = arg2body (bgpvpn ['id' ], parsed_args )
126- if self ._assoc_res_name == constants .NETWORK_ASSOC :
126+ if self ._resource == constants .NETWORK_ASSOC :
127127 client .update_bgpvpn_network_association (
128128 bgpvpn ['id' ], parsed_args .resource_association_id , ** body )
129- elif self ._assoc_res_name == constants .PORT_ASSOCS :
129+ elif self ._resource == constants .PORT_ASSOC :
130130 client .update_bgpvpn_port_association (
131131 bgpvpn ['id' ], parsed_args .resource_association_id , ** body )
132132 else :
@@ -165,9 +165,9 @@ def take_action(self, parsed_args):
165165 fails = 0
166166 for id in parsed_args .resource_association_ids :
167167 try :
168- if self ._assoc_res_name == constants .NETWORK_ASSOC :
168+ if self ._resource == constants .NETWORK_ASSOC :
169169 client .delete_bgpvpn_network_association (bgpvpn ['id' ], id )
170- elif self ._assoc_res_name == constants .PORT_ASSOCS :
170+ elif self ._resource == constants .PORT_ASSOC :
171171 client .delete_bgpvpn_port_association (bgpvpn ['id' ], id )
172172 else :
173173 client .delete_bgpvpn_router_association (bgpvpn ['id' ], id )
@@ -221,10 +221,10 @@ def take_action(self, parsed_args):
221221 params = {}
222222 if parsed_args .property :
223223 params .update (parsed_args .property )
224- if self ._assoc_res_name == constants .NETWORK_ASSOC :
224+ if self ._resource == constants .NETWORK_ASSOC :
225225 objs = client .bgpvpn_network_associations (
226226 bgpvpn ['id' ], retrieve_all = True , ** params )
227- elif self ._assoc_res_name == constants .PORT_ASSOCS :
227+ elif self ._resource == constants .PORT_ASSOC :
228228 objs = client .bgpvpn_port_associations (
229229 bgpvpn ['id' ], retrieve_all = True , ** params )
230230 else :
@@ -265,10 +265,10 @@ def get_parser(self, prog_name):
265265 def take_action (self , parsed_args ):
266266 client = self .app .client_manager .network
267267 bgpvpn = client .find_bgpvpn (parsed_args .bgpvpn )
268- if self ._assoc_res_name == constants .NETWORK_ASSOC :
268+ if self ._resource == constants .NETWORK_ASSOC :
269269 obj = client .get_bgpvpn_network_association (
270270 bgpvpn ['id' ], parsed_args .resource_association_id )
271- elif self ._assoc_res_name == constants .PORT_ASSOCS :
271+ elif self ._resource == constants .PORT_ASSOC :
272272 obj = client .get_bgpvpn_port_association (
273273 bgpvpn ['id' ], parsed_args .resource_association_id )
274274 else :
0 commit comments