@@ -140,8 +140,8 @@ def create_network_postcommit(self, context):
140
140
raise exc .NetworkNotFound (net_id = network_id ) from e
141
141
142
142
LOG .info (
143
- "network %(net_id)s has been added on ucvni_group %(ucvni_group), "
144
- "physnet %(physnet)" ,
143
+ "network %(net_id)s has been added on ucvni_group %(ucvni_group)s , "
144
+ "physnet %(physnet)s " ,
145
145
{"net_id" : network_id , "ucvni_group" : ucvni_group , "physnet" : physnet },
146
146
)
147
147
@@ -157,6 +157,28 @@ def delete_network_precommit(self, context):
157
157
def delete_network_postcommit (self , context ):
158
158
log_call ("delete_network_postcommit" , context )
159
159
160
+ network = context .current
161
+ network_id = network ["id" ]
162
+ provider_type = network .get ("provider:network_type" )
163
+ physnet = network .get ("provider:physical_network" )
164
+
165
+ if provider_type == p_const .TYPE_VXLAN :
166
+ conf = cfg .CONF .ml2_understack
167
+ ucvni_group = conf .ucvni_group
168
+ try :
169
+ self .nb .ucvni_delete (network_id )
170
+ except Exception as e :
171
+ LOG .exception (
172
+ "unable to delete network %(net_id)s" , {"net_id" : network_id }
173
+ )
174
+ raise exc .NetworkNotFound (net_id = network_id ) from e
175
+
176
+ LOG .info (
177
+ "network %(net_id)s has been deleted from ucvni_group %(ucvni_group)s, "
178
+ "physnet %(physnet)s" ,
179
+ {"net_id" : network_id , "ucvni_group" : ucvni_group , "physnet" : physnet },
180
+ )
181
+
160
182
def create_subnet_precommit (self , context ):
161
183
log_call ("create_subnet_precommit" , context )
162
184
0 commit comments