Make destroy network locale independent (#1413)

Make destroy network exceptio rely on e.libvirt_code instead of e.message
This commit is contained in:
Nicolas LE NEZET
2021-12-02 12:33:20 +01:00
committed by GitHub
parent 2d53c3a850
commit e741871fc4

View File

@@ -47,7 +47,7 @@ module VagrantPlugins
) )
rescue Libvirt::RetrieveError => e rescue Libvirt::RetrieveError => e
# this network is already destroyed, so move on # this network is already destroyed, so move on
if e.message =~ /Network not found/ if e.libvirt_code == ProviderLibvirt::Util::ErrorCodes::VIR_ERR_NO_NETWORK
@logger.info 'It is already undefined' @logger.info 'It is already undefined'
next next
# some other error occured, so raise it again # some other error occured, so raise it again