[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Mar 3 05:53:06 UTC 2016


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/20160303/097e33cc/attachment.bin>
-------------- next part --------------
From 7d2cd888db95c76ed92ff50445334c736d11b27b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 2 Mar 2016 19:53:56 -0500
Subject: [PATCH 1/2] Fix typo
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>
---
 lxc/image.go | 2 +-
 po/lxd.pot   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lxc/image.go b/lxc/image.go
index c411e37..8ba1941 100644
--- a/lxc/image.go
+++ b/lxc/image.go
@@ -385,7 +385,7 @@ func (c *imageCmd) run(config *lxd.Config, args []string) error {
 		}
 
 		handler := func(percent int) {
-			fmt.Printf(i18n.G("Transfering image: %d%%")+"\r", percent)
+			fmt.Printf(i18n.G("Transferring image: %d%%")+"\r", percent)
 			if percent == 100 {
 				fmt.Printf("\n")
 			}
diff --git a/po/lxd.pot b/po/lxd.pot
index 5457a2f..66686ae 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: 2016-03-02 17:16-0500\n"
+        "POT-Creation-Date: 2016-03-02 19:53-0500\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"
@@ -959,7 +959,7 @@ msgstr  ""
 
 #: lxc/image.go:388
 #, c-format
-msgid   "Transfering image: %d%%"
+msgid   "Transferring image: %d%%"
 msgstr  ""
 
 #: lxc/action.go:93 lxc/launch.go:130

From 9258c8b4eab47f68f538704e350828e3c430a448 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 3 Mar 2016 00:52:16 -0500
Subject: [PATCH 2/2] Fix incorrect device type in dbUpdateFromV26
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/db.go        |  2 +-
 lxd/db_update.go | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lxd/db.go b/lxd/db.go
index 75dfae5..be8be5a 100644
--- a/lxd/db.go
+++ b/lxd/db.go
@@ -34,7 +34,7 @@ type Profile struct {
 // Profiles will contain a list of all Profiles.
 type Profiles []Profile
 
-const DB_CURRENT_VERSION int = 27
+const DB_CURRENT_VERSION int = 28
 
 // CURRENT_SCHEMA contains the current SQLite SQL Schema.
 const CURRENT_SCHEMA string = `
diff --git a/lxd/db_update.go b/lxd/db_update.go
index 9f88ba8..798431d 100644
--- a/lxd/db_update.go
+++ b/lxd/db_update.go
@@ -15,6 +15,14 @@ import (
 	log "gopkg.in/inconshreveable/log15.v2"
 )
 
+func dbUpdateFromV27(db *sql.DB) error {
+	stmt := `
+UPDATE profiles_devices SET type=3 WHERE type='unix-char';
+INSERT INTO schema (version, updated_at) VALUES (?, strftime("%s"));`
+	_, err := db.Exec(stmt, 28)
+	return err
+}
+
 func dbUpdateFromV26(db *sql.DB) error {
 	stmt := `
 ALTER TABLE images ADD COLUMN auto_update INTEGER NOT NULL DEFAULT 0;
@@ -965,6 +973,12 @@ func dbUpdate(d *Daemon, prevVersion int) error {
 			return err
 		}
 	}
+	if prevVersion < 28 {
+		err = dbUpdateFromV27(db)
+		if err != nil {
+			return err
+		}
+	}
 
 	return nil
 }


More information about the lxc-devel mailing list