Validate kvm network exists

pull/4308/head
josedonizetti 2019-05-21 16:19:15 -03:00
parent af443fc3ac
commit e9a450df66
1 changed files with 3 additions and 1 deletions

View File

@ -117,9 +117,11 @@ func (d *Driver) createNetwork() error {
// network: default
// It is assumed that the libvirt/kvm installation has already created this network
if _, err := conn.LookupNetworkByName(d.Network); err != nil {
return errors.Wrapf(err, "network %s doesn't exist", d.Network)
}
// network: private
// Only create the private network if it does not already exist
if _, err := conn.LookupNetworkByName(d.PrivateNetwork); err != nil {
// create the XML for the private network from our networkTmpl