The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7904
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From e036ffc0f0da58b431905ab85d0b36b7de42c050 Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Mon, 21 Sep 2020 09:57:51 +0100 Subject: [PATCH] lxd/network/driver/ovn: Improve error message when parent 'network' option not specified Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxd/network/driver_ovn.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lxd/network/driver_ovn.go b/lxd/network/driver_ovn.go index 1c0f15230d..d136d47c46 100644 --- a/lxd/network/driver_ovn.go +++ b/lxd/network/driver_ovn.go @@ -73,13 +73,7 @@ func (n *ovn) Info() Info { // Validate network config. func (n *ovn) Validate(config map[string]string) error { rules := map[string]func(value string) error{ - "network": func(value string) error { - if err := validInterfaceName(value); err != nil { - return errors.Wrapf(err, "Invalid network name %q", value) - } - - return nil - }, + "network": validate.IsNotEmpty, "bridge.hwaddr": validate.Optional(validate.IsNetworkMAC), "bridge.mtu": validate.Optional(validate.IsNetworkMTU), "ipv4.address": func(value string) error { @@ -272,7 +266,7 @@ func (n *ovn) setupParentPort(routerMAC net.HardwareAddr) (*ovnParentVars, error // Parent network must be in default project. parentNet, err := LoadByName(n.state, project.Default, n.config["network"]) if err != nil { - return nil, errors.Wrapf(err, "Failed loading parent network") + return nil, errors.Wrapf(err, "Failed loading parent network %q", n.config["network"]) } switch parentNet.Type() {
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel