From a236fdd380bec0793b6198e5e8eb40aa30ab729d Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 14 Mar 2012 10:53:36 -0400 Subject: Update transfer_vhd to handle unicode correctly. Python 2.4's shlex implementation doesn't seem to like unicode. This updates the XenServer migration plugin so it converts to ascii before shlex'ing the rsync args. Fixes OSAPI resizes when using XenServer. Fixes LP Bug #955064. Change-Id: I7f2681bfe64ccde449a87c68b9739866a381a213 --- plugins/xenserver/xenapi/etc/xapi.d/plugins/migration | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration index 1e1fe0f5e..48436f5f3 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration @@ -112,8 +112,10 @@ def transfer_vhd(session, args): ssh_cmd = '\"ssh -o StrictHostKeyChecking=no\"' - rsync_args = shlex.split('nohup /usr/bin/rsync -av -e %s %s %s' - % (ssh_cmd, source_path, dest_path)) + # NOTE(dprince): shlex python 2.4 doesn't like unicode so we + # explicitly convert to ascii + rsync_args = shlex.split(('nohup /usr/bin/rsync -av -e %s %s %s' + % (ssh_cmd, source_path, dest_path)).encode('ascii')) logging.debug('rsync %s' % (' '.join(rsync_args, ))) -- cgit