def test_delete_networks(self): transport_zones_config = [{ 'zone_uuid': _uuid(), 'transport_type': 'stt' }] lswitch = switchlib.create_lswitch(self.fake_cluster, _uuid(), 'pippo', 'fake-switch', transport_zones_config) switchlib.delete_networks(self.fake_cluster, lswitch['uuid'], [lswitch['uuid']]) self.assertRaises(exceptions.NotFound, switchlib.get_lswitches, self.fake_cluster, lswitch['uuid'])
def test_delete_networks(self): transport_zones_config = [{'zone_uuid': _uuid(), 'transport_type': 'stt'}] lswitch = switchlib.create_lswitch(self.fake_cluster, _uuid(), 'pippo', 'fake-switch', transport_zones_config) switchlib.delete_networks(self.fake_cluster, lswitch['uuid'], [lswitch['uuid']]) self.assertRaises(exceptions.NotFound, switchlib.get_lswitches, self.fake_cluster, lswitch['uuid'])
def delete_network_precommit(self, context): nsx_switch_ids = nsx_utils.get_nsx_switch_ids( context._plugin_context.session, self.cluster, context.current['id'] ) try: switchlib.delete_networks( self.cluster, context.current['id'], nsx_switch_ids ) except n_exc.NotFound: LOG.warning(_("The following logical switches were not found " "on the NSX backend:%s"), nsx_switch_ids)