From 3cc2264eea7fb5e052459a9f00a047775a5eb88f Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 15 Jul 2013 21:21:04 +0000 Subject: [PATCH] xenapi: Pass string arguments to popen The current BitTorrent code was passing integer arguments to `make_subprocess` which would in turn pass those to `popen`. This would cause a failure because the semantics of the underlying `execve` function is to only accept a list of strings. The solution is to cast the arguments to a string before passing them into `make_subrpocess`. Fixes bug 1201594 Change-Id: I8372795ca032420641c449cb07bb47f9252ff4ef --- plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent b/plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent index 111741e607..28eb076ecc 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent @@ -169,9 +169,9 @@ def _seed(torrent_path, seed_cache_path, torrent_seed_duration, torrent_listen_port_start, torrent_listen_port_end): plugin_path = os.path.dirname(inspect.getabsfile(inspect.currentframe())) seeder_path = os.path.join(plugin_path, SEEDER_PROCESS) - seed_cmd = [seeder_path, torrent_path, seed_cache_path, - torrent_seed_duration, torrent_listen_port_start, - torrent_listen_port_end] + seed_cmd = map(str, [seeder_path, torrent_path, seed_cache_path, + torrent_seed_duration, torrent_listen_port_start, + torrent_listen_port_end]) utils.run_command(seed_cmd)