WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Fix "xe vm-export --metadata --multiple"

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Fix "xe vm-export --metadata --multiple"
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 6 May 2010 16:48:46 +0100
Delivery-date: Thu, 06 May 2010 08:48:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Hickey <ian.hickey@xxxxxxxxxx>
# Date 1273160895 -3600
# Node ID 77535ef46acd159c16e4c3e1eddb2934e16c5b43
# Parent  4bde1604fc1795fe826574335f34b5e2c3c75594
CA-41107: Fix 'xe vm-export --metadata --multiple'

The filename of each separate export needs to be changed to avoid a 'file 
already exists' type error.

Signed-off-by: Ian Hickey <ian.hickey@xxxxxxxxxx>
Acked-by: Dave Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 4bde1604fc17 -r 77535ef46acd ocaml/xapi/cli_operations.ml
--- a/ocaml/xapi/cli_operations.ml      Thu Apr 29 10:22:35 2010 +0100
+++ b/ocaml/xapi/cli_operations.ml      Thu May 06 16:48:15 2010 +0100
@@ -3073,7 +3073,8 @@
   
   finally 
     (fun () ->
-      download_file ~__context rpc session_id exporttask fd filename
+      let f = if !num > 1 then filename ^ (string_of_int !num) else filename in
+      download_file ~__context rpc session_id exporttask fd f
         (Printf.sprintf
            "%s?session_id=%s&task_id=%s&ref=%s&preserve_power_state=%b" 
           (if List.mem_assoc "metadata" params
1 file changed, 2 insertions(+), 1 deletion(-)
ocaml/xapi/cli_operations.ml |    3 ++-


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Fix "xe vm-export --metadata --multiple", David Scott <=