[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Mon Mar 20 23:10:49 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170320/068787e0/attachment.bin>
-------------- next part --------------
From acbb654e884bd1e7b511e1f25b637cf57d7a9585 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 20 Mar 2017 18:45:29 -0400
Subject: [PATCH 1/2] lxc/copy: Return the source error too
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This will get us rid off the annoying "bad handshake" error.

Closes #3086

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 client.go   | 10 +++++++++-
 lxc/copy.go |  9 ++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/client.go b/client.go
index a0a1050..520228e 100644
--- a/client.go
+++ b/client.go
@@ -2225,7 +2225,6 @@ func (c *Client) WaitFor(waitURL string) (*api.Operation, error) {
 	 * "/<version>/operations/" in it; we chop off the leading / and pass
 	 * it to url directly.
 	 */
-	shared.LogDebugf(path.Join(waitURL[1:], "wait"))
 	resp, err := c.baseGet(c.url(waitURL, "wait"))
 	if err != nil {
 		return nil, err
@@ -2234,6 +2233,15 @@ func (c *Client) WaitFor(waitURL string) (*api.Operation, error) {
 	return resp.MetadataAsOperation()
 }
 
+func (c *Client) GetOperation(url string) (*api.Operation, error) {
+	resp, err := c.baseGet(c.url(url))
+	if err != nil {
+		return nil, err
+	}
+
+	return resp.MetadataAsOperation()
+}
+
 func (c *Client) WaitForSuccess(waitURL string) error {
 	op, err := c.WaitFor(waitURL)
 	if err != nil {
diff --git a/lxc/copy.go b/lxc/copy.go
index 0e6445d..1ff5dd5 100644
--- a/lxc/copy.go
+++ b/lxc/copy.go
@@ -245,7 +245,14 @@ func (c *copyCmd) copyContainer(config *lxd.Config, sourceResource string, destR
 		return nil
 	}
 
-	return err
+	// Check for an error at the source
+	sourceOp, sourceErr := source.GetOperation(sourceWSResponse.Operation)
+	if sourceErr == nil && sourceOp.Err != "" {
+		return fmt.Errorf(i18n.G("Migration failed on source host: %s"), sourceOp.Err)
+	}
+
+	// Return the error from destination
+	return fmt.Errorf(i18n.G("Migration failed on target host: %s"), err)
 }
 
 func (c *copyCmd) run(config *lxd.Config, args []string) error {

From 3551211753dcd197a3771aae33eb0e5e34b4fc2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 20 Mar 2017 19:10:23 -0400
Subject: [PATCH 2/2] i18n: Update translation templates
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>
---
 po/de.po   | 12 +++++++++++-
 po/el.po   | 12 +++++++++++-
 po/fr.po   | 12 +++++++++++-
 po/ja.po   | 12 +++++++++++-
 po/lxd.pot | 12 +++++++++++-
 po/nl.po   | 12 +++++++++++-
 po/ru.po   | 12 +++++++++++-
 7 files changed, 77 insertions(+), 7 deletions(-)

diff --git a/po/de.po b/po/de.po
index 2ee7c74..96bcfaa 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LXD\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: 2017-02-14 17:11+0000\n"
 "Last-Translator: Tim Rose <tim at netlope.de>\n"
 "Language-Team: German <https://hosted.weblate.org/projects/linux-containers/"
@@ -629,6 +629,16 @@ msgstr ""
 msgid "Memory usage:"
 msgstr ""
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr "Fehlende Zusammenfassung."
diff --git a/po/el.po b/po/el.po
index 8afd5d3..82e7d65 100644
--- a/po/el.po
+++ b/po/el.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: lxd\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: 2017-02-14 08:00+0000\n"
 "Last-Translator: Simos Xenitellis <simos.65 at gmail.com>\n"
 "Language-Team: Greek <https://hosted.weblate.org/projects/linux-containers/"
@@ -533,6 +533,16 @@ msgstr ""
 msgid "Memory usage:"
 msgstr "  Χρήση μνήμης:"
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr ""
diff --git a/po/fr.po b/po/fr.po
index 1658caf..476f9a4 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LXD\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: 2017-02-24 23:43+0000\n"
 "Last-Translator: Christophe CHAUVET <christophe.chauvet at gmail.com>\n"
 "Language-Team: French <https://hosted.weblate.org/projects/linux-containers/"
@@ -618,6 +618,16 @@ msgstr "Mémoire (pointe)"
 msgid "Memory usage:"
 msgstr "  Mémoire utilisée :"
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr "Résumé manquant."
diff --git a/po/ja.po b/po/ja.po
index 97d701f..27719d4 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LXD\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: 2017-03-02 00:50+0000\n"
 "Last-Translator: KATOH Yasufumi <karma at jazz.email.ne.jp>\n"
 "Language-Team: Japanese <https://hosted.weblate.org/projects/linux-"
@@ -532,6 +532,16 @@ msgstr "メモリ (ピーク)"
 msgid "Memory usage:"
 msgstr "メモリ消費量:"
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr "サマリーはありません。"
diff --git a/po/lxd.pot b/po/lxd.pot
index dd9f518..9efcefd 100644
--- a/po/lxd.pot
+++ b/po/lxd.pot
@@ -7,7 +7,7 @@
 msgid   ""
 msgstr  "Project-Id-Version: lxd\n"
         "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-        "POT-Creation-Date: 2017-03-20 14:50-0400\n"
+        "POT-Creation-Date: 2017-03-20 19:10-0400\n"
         "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
         "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
         "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -520,6 +520,16 @@ msgstr  ""
 msgid   "Memory usage:"
 msgstr  ""
 
+#: lxc/copy.go:251
+#, c-format
+msgid   "Migration failed on source host: %s"
+msgstr  ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid   "Migration failed on target host: %s"
+msgstr  ""
+
 #: lxc/utils.go:173
 msgid   "Missing summary."
 msgstr  ""
diff --git a/po/nl.po b/po/nl.po
index 3cfd1e3..0ad280b 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: lxd\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Automatically generated\n"
 "Language-Team: none\n"
@@ -527,6 +527,16 @@ msgstr ""
 msgid "Memory usage:"
 msgstr ""
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 36642aa..0da9d42 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: lxd\n"
 "Report-Msgid-Bugs-To: lxc-devel at lists.linuxcontainers.org\n"
-"POT-Creation-Date: 2017-03-20 14:50-0400\n"
+"POT-Creation-Date: 2017-03-20 19:10-0400\n"
 "PO-Revision-Date: 2017-02-14 09:54+0000\n"
 "Last-Translator: Vyacheslav Razykov <v.razykov at gmail.com>\n"
 "Language-Team: Russian <https://hosted.weblate.org/projects/linux-containers/"
@@ -601,6 +601,16 @@ msgstr ""
 msgid "Memory usage:"
 msgstr " Использование памяти:"
 
+#: lxc/copy.go:251
+#, c-format
+msgid "Migration failed on source host: %s"
+msgstr ""
+
+#: lxc/copy.go:255
+#, c-format
+msgid "Migration failed on target host: %s"
+msgstr ""
+
 #: lxc/utils.go:173
 msgid "Missing summary."
 msgstr ""


More information about the lxc-devel mailing list