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

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) ===
let's always include the path, so it's obvious which device is broken.

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
From 0f708ae6e2e04ff5b1beb399bf41c7b6f9a192b3 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.ander...@canonical.com>
Date: Tue, 12 Jul 2016 12:33:32 -0600
Subject: [PATCH] better errors when sanity checking devices

let's always include the path, so it's obvious which device is broken.

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
---
 lxd/container_lxc.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 7cde497..5d1503b 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -3536,10 +3536,10 @@ func (c *containerLXC) createUnixDevice(name string, m 
shared.Device) (string, e
                // If no major and minor are set, use those from the device on 
the host
                _, major, minor, err = deviceGetAttributes(srcPath)
                if err != nil {
-                       return "", fmt.Errorf("Failed to get device attributes: 
%s", err)
+                       return "", fmt.Errorf("Failed to get device attributes 
for %s: %s", m["path"], err)
                }
        } else if m["major"] == "" || m["minor"] == "" {
-               return "", fmt.Errorf("Both major and minor must be supplied 
for devices")
+               return "", fmt.Errorf("Both major and minor must be supplied 
for device: %s", m["path"])
        } else {
                major, err = strconv.Atoi(m["major"])
                if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to