The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4487

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Closes #4486

Signed-off-by: Stéphane Graber <[email protected]>
From bb07131d9e9cb1312b572571c068c9d748656dc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Mon, 23 Apr 2018 22:19:28 -0400
Subject: [PATCH] lxc/rename: Deal with remote renames
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4486

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxc/rename.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lxc/rename.go b/lxc/rename.go
index fce0282b5..7a3f08c2c 100644
--- a/lxc/rename.go
+++ b/lxc/rename.go
@@ -2,6 +2,7 @@ package main
 
 import (
        "fmt"
+       "strings"
 
        "github.com/spf13/cobra"
 
@@ -45,7 +46,13 @@ func (c *cmdRename) Run(cmd *cobra.Command, args []string) 
error {
        }
 
        if sourceRemote != destRemote {
-               return fmt.Errorf(i18n.G("Can't specify a different remote for 
rename."))
+               // We just do renames
+               if strings.Contains(args[1], ":") {
+                       return fmt.Errorf(i18n.G("Can't specify a different 
remote for rename."))
+               }
+
+               // Don't require the remote to be passed as both source and 
target
+               args[1] = fmt.Sprintf("%s:%s", sourceRemote, args[1])
        }
 
        // Call move
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to