[lxc-devel] [lxd/master] Doc fixes, typo fixes and unused variable fixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Nov 9 20:55:55 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/20171109/db08ae1e/attachment.bin>
-------------- next part --------------
From 6ed143ce7cf006c2bd220f84a8aec42232d840ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 9 Nov 2017 15:48:58 -0500
Subject: [PATCH 1/3] client: Name all the return values in interfaces
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>
---
 client/interfaces.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/client/interfaces.go b/client/interfaces.go
index 86292ace2..5c8e8ee54 100644
--- a/client/interfaces.go
+++ b/client/interfaces.go
@@ -43,9 +43,9 @@ type ContainerServer interface {
 
 	// Server functions
 	GetServer() (server *api.Server, ETag string, err error)
-	GetServerResources() (*api.Resources, error)
+	GetServerResources() (resources *api.Resources, err error)
 	UpdateServer(server api.ServerPut, ETag string) (err error)
-	HasExtension(extension string) bool
+	HasExtension(extension string) (exists bool)
 	RequireAuthenticated(authenticated bool)
 
 	// Certificate functions
@@ -68,7 +68,7 @@ type ContainerServer interface {
 	MigrateContainer(name string, container api.ContainerPost) (op *Operation, err error)
 	DeleteContainer(name string) (op *Operation, err error)
 
-	ExecContainer(containerName string, exec api.ContainerExecPost, args *ContainerExecArgs) (*Operation, error)
+	ExecContainer(containerName string, exec api.ContainerExecPost, args *ContainerExecArgs) (op *Operation, err error)
 
 	GetContainerFile(containerName string, path string) (content io.ReadCloser, resp *ContainerFileResponse, err error)
 	CreateContainerFile(containerName string, path string, args ContainerFileArgs) (err error)
@@ -90,8 +90,8 @@ type ContainerServer interface {
 	GetContainerLogfile(name string, filename string) (content io.ReadCloser, err error)
 	DeleteContainerLogfile(name string, filename string) (err error)
 
-	GetContainerMetadata(name string) (*api.ImageMetadata, string, error)
-	SetContainerMetadata(name string, metadata api.ImageMetadata, ETag string) error
+	GetContainerMetadata(name string) (metadata *api.ImageMetadata, ETag string, err error)
+	SetContainerMetadata(name string, metadata api.ImageMetadata, ETag string) (err error)
 
 	GetContainerTemplateFiles(containerName string) (templates []string, err error)
 	GetContainerTemplateFile(containerName string, templateName string) (content io.ReadCloser, err error)

From 0d8afc22904b1843836051a10476910dc25f9857 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 9 Nov 2017 15:53:00 -0500
Subject: [PATCH 2/3] lxd/import: Use the right VG name on delete
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/api_internal.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/api_internal.go b/lxd/api_internal.go
index 5c571c513..b73095bac 100644
--- a/lxd/api_internal.go
+++ b/lxd/api_internal.go
@@ -396,7 +396,7 @@ func internalImport(d *Daemon, r *http.Request) Response {
 			snapName := fmt.Sprintf("%s/%s", req.Name, od)
 			snapPath := containerPath(snapName, true)
 			err = lvmContainerDeleteInternal(poolName, req.Name,
-				true, poolName, snapPath)
+				true, onDiskPoolName, snapPath)
 		case "ceph":
 			clusterName := "ceph"
 			if backup.Pool.Config["ceph.cluster_name"] != "" {

From 6f2877ee9ab5e86fe178215ee002eb1ebba1f3a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 9 Nov 2017 15:54:58 -0500
Subject: [PATCH 3/3] Fix some typos
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/daemon.go               | 2 +-
 lxd/db/query/transaction.go | 2 +-
 lxd/db/schema/schema.go     | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lxd/daemon.go b/lxd/daemon.go
index ef09488b8..6968e08ae 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -314,7 +314,7 @@ func setupSharedMounts() error {
 func (d *Daemon) Init() error {
 	err := d.init()
 
-	// If an error occured synchronously while starting up, let's try to
+	// If an error occurred synchronously while starting up, let's try to
 	// cleanup any state we produced so far. Errors happening here will be
 	// ignored.
 	if err != nil {
diff --git a/lxd/db/query/transaction.go b/lxd/db/query/transaction.go
index 122c3af2a..4d23d1f11 100644
--- a/lxd/db/query/transaction.go
+++ b/lxd/db/query/transaction.go
@@ -20,7 +20,7 @@ func Transaction(db *sql.DB, f func(*sql.Tx) error) error {
 	return tx.Commit()
 }
 
-// Rollback a transaction after the given error occured. If the rollback
+// Rollback a transaction after the given error occurred. If the rollback
 // succeeds the given error is returned, otherwise a new error that wraps it
 // gets generated and returned.
 func rollback(tx *sql.Tx, reason error) error {
diff --git a/lxd/db/schema/schema.go b/lxd/db/schema/schema.go
index c45c67a80..ba798984c 100644
--- a/lxd/db/schema/schema.go
+++ b/lxd/db/schema/schema.go
@@ -48,7 +48,7 @@ func New(updates []Update) *Schema {
 // (i.e. there are no missing versions).
 //
 // NOTE: the regular New() constructor would be formally enough, but for extra
-//       clarity we also support a map that indicates the version explicitely,
+//       clarity we also support a map that indicates the version explicitly,
 //       see also PR #3704.
 func NewFromMap(versionsToUpdates map[int]Update) *Schema {
 	// Collect all version keys.
@@ -220,7 +220,7 @@ func (s *Schema) Trim(version int) []Update {
 // schema.
 //
 // It first creates an in-memory SQLite database, then it applies all updates
-// up to the one with given version (exlcuded) and optionally executes the
+// up to the one with given version (excluded) and optionally executes the
 // given hook for populating the database with test data. Finally it applies
 // the update with the given version, returning the database handle for further
 // inspection of the resulting state.
@@ -339,7 +339,7 @@ func ensureUpdatesAreApplied(tx *sql.Tx, current int, updates []Update, hook Hoo
 }
 
 // Check that the given list of update version numbers doesn't have "holes",
-// that is each version equal the preceeding version plus 1.
+// that is each version equal the preceding version plus 1.
 func checkSchemaVersionsHaveNoHoles(versions []int) error {
 	// Sanity check that there are no "holes" in the recorded
 	// versions.


More information about the lxc-devel mailing list