Skip to content

Commit

Permalink
Update transfer_vhd to handle unicode correctly.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dprince committed Mar 14, 2012
1 parent 78a067e commit a236fdd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
Expand Up @@ -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, )))

Expand Down

0 comments on commit a236fdd

Please sign in to comment.