[lxc-devel] [lxd/master] allow nil network config

tych0 on Github lxc-bot at linuxcontainers.org
Thu Sep 29 22:13:54 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160929/65585fc4/attachment.bin>
-------------- next part --------------
From 8f856e40d65f3c3e2f60c7d945e11fcf27e7cbc3 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Thu, 29 Sep 2016 22:13:22 +0000
Subject: [PATCH] allow nil network config

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 lxd/networks.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/networks.go b/lxd/networks.go
index c27b12d..a85a0dd 100644
--- a/lxd/networks.go
+++ b/lxd/networks.go
@@ -84,6 +84,10 @@ func networksPost(d *Daemon, r *http.Request) Response {
 		return BadRequest(fmt.Errorf("The network already exists"))
 	}
 
+	if req.Config == nil {
+		req.Config = map[string]string{}
+	}
+
 	err = networkValidateConfig(req.Name, req.Config)
 	if err != nil {
 		return BadRequest(err)


More information about the lxc-devel mailing list