The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7257

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) ===
It's always missing during `lxd init` when run from the snap, even if
the daemon itself has access to it.

Closes #7256

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From b16e8eca99acbd0477da2749fe2594e4011ec6a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Sat, 25 Apr 2020 11:48:58 -0400
Subject: [PATCH] share/usbid: Don't print error when missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It's always missing during `lxd init` when run from the snap, even if
the daemon itself has access to it.

Closes #7256

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 shared/usbid/load.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shared/usbid/load.go b/shared/usbid/load.go
index acbefc1e12..39f6c4d831 100644
--- a/shared/usbid/load.go
+++ b/shared/usbid/load.go
@@ -31,7 +31,9 @@ var (
 func init() {
        usbids, err := os.Open("/usr/share/misc/usb.ids")
        if err != nil {
-               log.Printf("usbid: failed to load: %s", err)
+               if !os.IsNotExist(err) {
+                       log.Printf("usbid: failed to load: %s", err)
+               }
                return
        }
        defer usbids.Close()
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to