[lxc-devel] [lxd/master] lxc: Better handle copy/move between projects

stgraber on Github lxc-bot at linuxcontainers.org
Mon Oct 5 22:26:38 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201005/2ca94228/attachment.bin>
-------------- next part --------------
From 43ec7184b1987399b37459618ff68d4a8f6dce8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 5 Oct 2020 18:22:21 -0400
Subject: [PATCH] lxc: Better handle copy/move between projects
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/copy.go | 2 +-
 lxc/move.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxc/copy.go b/lxc/copy.go
index be3d576f68..7b88270ee4 100644
--- a/lxc/copy.go
+++ b/lxc/copy.go
@@ -403,7 +403,7 @@ func (c *cmdCopy) copyInstance(conf *config.Config, sourceResource string, destR
 	}
 
 	// If choosing a random name, show it to the user
-	if destResource == "" {
+	if destResource == "" && c.flagTargetProject == "" {
 		// Get the successful operation data
 		opInfo, err := op.GetTarget()
 		if err != nil {
diff --git a/lxc/move.go b/lxc/move.go
index 182021c0f4..8a1b812976 100644
--- a/lxc/move.go
+++ b/lxc/move.go
@@ -64,7 +64,7 @@ func (c *cmdMove) Run(cmd *cobra.Command, args []string) error {
 	conf := c.global.conf
 
 	// Sanity checks
-	if c.flagTarget == "" {
+	if c.flagTarget == "" && c.flagTargetProject == "" {
 		exit, err := c.global.CheckArgs(cmd, args, 2, 2)
 		if exit {
 			return err


More information about the lxc-devel mailing list