[lxc-devel] [lxd/master] lxd: Add "instance" string where necessary

monstermunchkin on Github lxc-bot at linuxcontainers.org
Fri Mar 13 18:23:18 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 355 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200313/200536cc/attachment.bin>
-------------- next part --------------
From aa53faf5e5d5e4eed9730280b0f535e82b3653d7 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 13 Mar 2020 19:20:47 +0100
Subject: [PATCH] lxd: Add "instance" string where necessary

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 lxd/backup.go              | 8 ++++----
 lxd/db/operations_types.go | 4 ++--
 lxd/instance.go            | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lxd/backup.go b/lxd/backup.go
index 2b10e87f67..cccdf585da 100644
--- a/lxd/backup.go
+++ b/lxd/backup.go
@@ -228,16 +228,16 @@ func pruneExpiredContainerBackupsTask(d *Daemon) (task.Func, task.Schedule) {
 
 		op, err := operations.OperationCreate(d.State(), "", operations.OperationClassTask, db.OperationBackupsExpire, nil, nil, opRun, nil, nil)
 		if err != nil {
-			logger.Error("Failed to start expired backups operation", log.Ctx{"err": err})
+			logger.Error("Failed to start expired instance backups operation", log.Ctx{"err": err})
 			return
 		}
 
-		logger.Info("Pruning expired container backups")
+		logger.Info("Pruning expired instance backups")
 		_, err = op.Run()
 		if err != nil {
-			logger.Error("Failed to expire backups", log.Ctx{"err": err})
+			logger.Error("Failed to expire instance backups", log.Ctx{"err": err})
 		}
-		logger.Info("Done pruning expired container backups")
+		logger.Info("Done pruning expired instance backups")
 	}
 
 	f(context.Background())
diff --git a/lxd/db/operations_types.go b/lxd/db/operations_types.go
index 0e48df3b91..367a7b2b16 100644
--- a/lxd/db/operations_types.go
+++ b/lxd/db/operations_types.go
@@ -147,9 +147,9 @@ func (t OperationType) Description() string {
 	case OperationInstanceTypesUpdate:
 		return "Updating instance types"
 	case OperationBackupsExpire:
-		return "Cleaning up expired backups"
+		return "Cleaning up expired instance backups"
 	case OperationSnapshotsExpire:
-		return "Cleaning up expired snapshots"
+		return "Cleaning up expired instance snapshots"
 	default:
 		return "Executing operation"
 	}
diff --git a/lxd/instance.go b/lxd/instance.go
index 85a02f2eb3..eb306f4d62 100644
--- a/lxd/instance.go
+++ b/lxd/instance.go
@@ -878,7 +878,7 @@ func pruneExpiredContainerSnapshotsTask(d *Daemon) (task.Func, task.Schedule) {
 		for _, c := range allInstances {
 			snapshots, err := c.Snapshots()
 			if err != nil {
-				logger.Error("Failed to list snapshots", log.Ctx{"err": err, "container": c.Name(), "project": c.Project()})
+				logger.Error("Failed to list instance snapshots", log.Ctx{"err": err, "instance": c.Name(), "project": c.Project()})
 				continue
 			}
 
@@ -906,7 +906,7 @@ func pruneExpiredContainerSnapshotsTask(d *Daemon) (task.Func, task.Schedule) {
 
 		op, err := operations.OperationCreate(d.State(), "", operations.OperationClassTask, db.OperationSnapshotsExpire, nil, nil, opRun, nil, nil)
 		if err != nil {
-			logger.Error("Failed to start expired snapshots operation", log.Ctx{"err": err})
+			logger.Error("Failed to start expired instance snapshots operation", log.Ctx{"err": err})
 			return
 		}
 
@@ -940,7 +940,7 @@ func pruneExpiredContainerSnapshots(ctx context.Context, d *Daemon, snapshots []
 	for _, snapshot := range snapshots {
 		err := snapshot.Delete()
 		if err != nil {
-			return errors.Wrapf(err, "Failed to delete expired snapshot '%s' in project '%s'", snapshot.Name(), snapshot.Project())
+			return errors.Wrapf(err, "Failed to delete expired instance snapshot '%s' in project '%s'", snapshot.Name(), snapshot.Project())
 		}
 	}
 


More information about the lxc-devel mailing list