summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-03-14 10:53:36 -0400
committerDan Prince <dprince@redhat.com>2012-03-14 10:53:36 -0400
commita236fdd380bec0793b6198e5e8eb40aa30ab729d (patch)
tree08b292d0110ad745567854169aa4a8051515bf4d
parent78a067e9d3b848067b933d58a2abecc96753bc36 (diff)
downloadnova-a236fdd380bec0793b6198e5e8eb40aa30ab729d.tar.gz
nova-a236fdd380bec0793b6198e5e8eb40aa30ab729d.tar.xz
nova-a236fdd380bec0793b6198e5e8eb40aa30ab729d.zip
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
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/migration6
1 files 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, )))