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

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) ===
Closes #3859.

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 81a4f459280619bfa4b5a5635bb8ab0eb70edf5a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Fri, 29 Sep 2017 15:48:28 +0200
Subject: [PATCH] rsync: ignore vanished file warnings

Closes #3859.

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 lxd/rsync.go | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lxd/rsync.go b/lxd/rsync.go
index e5f4d3d0c..3659fefbf 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -7,6 +7,7 @@ import (
        "net"
        "os"
        "os/exec"
+       "syscall"
 
        "github.com/gorilla/websocket"
        "github.com/pborman/uuid"
@@ -31,7 +32,7 @@ func rsyncLocalCopy(source string, dest string, bwlimit 
string) (string, error)
                bwlimit = "0"
        }
 
-       return shared.RunCommand("rsync",
+       msg, err := shared.RunCommand("rsync",
                "-a",
                "-HAX",
                "--sparse",
@@ -43,6 +44,21 @@ func rsyncLocalCopy(source string, dest string, bwlimit 
string) (string, error)
                rsyncVerbosity,
                shared.AddSlash(source),
                dest)
+       if err != nil {
+               runError, ok := err.(shared.RunError)
+               if ok {
+                       exitError, ok := runError.Err.(*exec.ExitError)
+                       if ok {
+                               waitStatus := 
exitError.Sys().(syscall.WaitStatus)
+                               if waitStatus.ExitStatus() == 24 {
+                                       return msg, nil
+                               }
+                       }
+               }
+               return msg, err
+       }
+
+       return msg, nil
 }
 
 func rsyncSendSetup(name string, path string, bwlimit string) (*exec.Cmd, 
net.Conn, io.ReadCloser, error) {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to