[lxc-devel] [lxd/master] lxd/dnsmasq: Don't fail file deletion if missing
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Jul 31 18:17:34 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190731/b8f00df3/attachment.bin>
-------------- next part --------------
From dd36fbe036639503ae646b24b2a6ab14e6828c82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 31 Jul 2019 14:17:16 -0400
Subject: [PATCH] lxd/dnsmasq: Don't fail file deletion if missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/dnsmasq/dnsmasq.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lxd/dnsmasq/dnsmasq.go b/lxd/dnsmasq/dnsmasq.go
index e5bf9fb5b4..b173bba61e 100644
--- a/lxd/dnsmasq/dnsmasq.go
+++ b/lxd/dnsmasq/dnsmasq.go
@@ -62,7 +62,7 @@ func UpdateStaticEntry(network string, projectName string, instanceName string,
// RemoveStaticEntry removes a single dhcp-host line for a network/instance combination.
func RemoveStaticEntry(network string, projectName string, instanceName string) error {
err := os.Remove(shared.VarPath("networks", network, "dnsmasq.hosts", project.Prefix(projectName, instanceName)))
- if err != nil {
+ if err != nil && !os.IsNotExist(err) {
return err
}
More information about the lxc-devel
mailing list