)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94bd87521a1d6fe0cae7eebed79db77adaa12d78","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"xenapi: Do not spawn a shell to run xe commands in xenhost Xapi plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":" * Remove shell\u003dTrue parameter from Popen call in _run_command, and"},{"line_number":10,"context_line":"   change calls to _run command to pass lists of arguments instead of"},{"line_number":11,"context_line":"   single strings"},{"line_number":12,"context_line":" * Merge _run_command_with_input into _run_command, as after the first"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAPn%2F%2Fnfw%3D","line":9,"updated":"2013-06-26 17:10:36.000000000","message":"would be good to express a bit more of the intent here. See: https://wiki.openstack.org/wiki/GitCommitMessages\n\nI think what you mean is something like:\ntidy up calls to popen to stop command injection attacks","commit_id":"8d6171c2af184027d2110e4590ba3c20edf31ffb"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"d2f3fb0b342ecd512f62bb481ffaadc7427ec3f9","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"xenapi: Do not spawn a shell to run xe commands in xenhost Xapi plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":" * Remove shell\u003dTrue parameter from Popen call in _run_command, and"},{"line_number":10,"context_line":"   change calls to _run command to pass lists of arguments instead of"},{"line_number":11,"context_line":"   single strings"},{"line_number":12,"context_line":" * Merge _run_command_with_input into _run_command, as after the first"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAPn%2F%2Fnac%3D","line":9,"in_reply_to":"AAAAPn%2F%2Fnfw%3D","updated":"2013-06-26 17:30:57.000000000","message":"Done","commit_id":"8d6171c2af184027d2110e4590ba3c20edf31ffb"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/bittorrent":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5d7c871d60d2bc2aafed6cd2e9e50a45191df12b","unresolved":false,"context_lines":[{"line_number":169,"context_line":"          torrent_listen_port_start, torrent_listen_port_end):"},{"line_number":170,"context_line":"    plugin_path \u003d os.path.dirname(inspect.getabsfile(inspect.currentframe()))"},{"line_number":171,"context_line":"    seeder_path \u003d os.path.join(plugin_path, SEEDER_PROCESS)"},{"line_number":172,"context_line":"    seed_cmd \u003d [seeder_path, torrent_path, seed_cache_path, "},{"line_number":173,"context_line":"                torrent_seed_duration, torrent_listen_port_start, "},{"line_number":174,"context_line":"                torrent_listen_port_end]"},{"line_number":175,"context_line":"    utils.run_command(seed_cmd)"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAPn%2F%2FXVs%3D","line":172,"updated":"2013-07-03 08:57:11.000000000","message":"Some whitespace to remove here.","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"1f93857f0974579063481ec8f1dfe46e4ae8b812","unresolved":false,"context_lines":[{"line_number":169,"context_line":"          torrent_listen_port_start, torrent_listen_port_end):"},{"line_number":170,"context_line":"    plugin_path \u003d os.path.dirname(inspect.getabsfile(inspect.currentframe()))"},{"line_number":171,"context_line":"    seeder_path \u003d os.path.join(plugin_path, SEEDER_PROCESS)"},{"line_number":172,"context_line":"    seed_cmd \u003d [seeder_path, torrent_path, seed_cache_path, "},{"line_number":173,"context_line":"                torrent_seed_duration, torrent_listen_port_start, "},{"line_number":174,"context_line":"                torrent_listen_port_end]"},{"line_number":175,"context_line":"    utils.run_command(seed_cmd)"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAPn%2F%2FXTc%3D","line":172,"in_reply_to":"AAAAPn%2F%2FXVs%3D","updated":"2013-07-03 09:02:42.000000000","message":"Done","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/migration":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5d7c871d60d2bc2aafed6cd2e9e50a45191df12b","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    dest_path \u003d \u0027%s@%s:/images/instance%s/\u0027 % (user, host, instance_uuid)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    rsync_cmd \u003d [\"/usr/bin/rsync\", \"-av\", \"--progress\", \"-e\", ssh_cmd, "},{"line_number":44,"context_line":"                 staging_path, dest_path]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    # NOTE(hillad): rsync\u0027s progress is carriage returned, requiring"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAPn%2F%2FXVk%3D","line":43,"updated":"2013-07-03 08:57:11.000000000","message":"whitespace here","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"1f93857f0974579063481ec8f1dfe46e4ae8b812","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    dest_path \u003d \u0027%s@%s:/images/instance%s/\u0027 % (user, host, instance_uuid)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    rsync_cmd \u003d [\"/usr/bin/rsync\", \"-av\", \"--progress\", \"-e\", ssh_cmd, "},{"line_number":44,"context_line":"                 staging_path, dest_path]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    # NOTE(hillad): rsync\u0027s progress is carriage returned, requiring"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAPn%2F%2FXTY%3D","line":43,"in_reply_to":"AAAAPn%2F%2FXVk%3D","updated":"2013-07-03 09:02:42.000000000","message":"Done","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5361119ef1bf2699acff3b63ac63feb21e1aa9fc","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    ret \u003d proc.returncode"},{"line_number":91,"context_line":"    if ret not in ok_exit_codes:"},{"line_number":92,"context_line":"        raise SubprocessException(\u0027 \u0027.join(cmdline), ret, out, err)"},{"line_number":93,"context_line":"    return out"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def run_command(cmd, cmd_input\u003dNone, ok_exit_codes\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FhSc%3D","line":92,"updated":"2013-06-28 16:29:26.000000000","message":"Defining and raising this separate exception seems a little odd to me. subprocess.CalledProcessError already means \"nonzero exit\", so it seems applicable here if we\u0027re defining the \"okay_exit_codes\" to be something other than [0].","commit_id":"68d51c68c520b7c9af9b8ef8ea56174658bef93a"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"964e34e2e77b519ed1df079d0e0405dccf2197e7","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    ret \u003d proc.returncode"},{"line_number":91,"context_line":"    if ret not in ok_exit_codes:"},{"line_number":92,"context_line":"        raise SubprocessException(\u0027 \u0027.join(cmdline), ret, out, err)"},{"line_number":93,"context_line":"    return out"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def run_command(cmd, cmd_input\u003dNone, ok_exit_codes\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2Fd6w%3D","line":92,"in_reply_to":"AAAAPn%2F%2FhLw%3D","updated":"2013-07-01 11:05:22.000000000","message":"I had a look at using CalledProcessError here - we can\u0027t use it in any case because we are running Python 2.4 in dom0 and it doesn\u0027t provide that exception.","commit_id":"68d51c68c520b7c9af9b8ef8ea56174658bef93a"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"53cd1507f5950d41d206c259ae828b39a67e9317","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    ret \u003d proc.returncode"},{"line_number":91,"context_line":"    if ret not in ok_exit_codes:"},{"line_number":92,"context_line":"        raise SubprocessException(\u0027 \u0027.join(cmdline), ret, out, err)"},{"line_number":93,"context_line":"    return out"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def run_command(cmd, cmd_input\u003dNone, ok_exit_codes\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FhLw%3D","line":92,"in_reply_to":"AAAAPn%2F%2FhSc%3D","updated":"2013-06-28 17:03:05.000000000","message":"The three different implementations of _run_command that were here originally returned slightly different exceptions, wrapping the results up differently.   make_subprocess/finish_subprocess went a different way, throwing an ordinary Exception with a formatted error message.   Some of these exceptions are caught and dealt with, others just propagate without ever being checked.   \n\nThe new exception captures cmdline, retcode, stdout and stderr, which are needed to reconstruct the different exceptions (possibly) expected by the callers of the original _run_command methods.   It also behaves like the original Exception raised by finish_subprocess, when handled as such.   subprocess.CalledProcessError only holds returncode, cmd and output, so if you have both stdout and stderr you can\u0027t use it.\n\nAll this effort is to try to keep exactly the same exception types while consolidating the logic.  If changing the exceptions is ok, a lot of this complexity can go away.  I\u0027m not yet sufficiently familiar with the rest of the code to be able to tell whether that would be ok, or would break something (which might then not show up in the tests).","commit_id":"68d51c68c520b7c9af9b8ef8ea56174658bef93a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5d7c871d60d2bc2aafed6cd2e9e50a45191df12b","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        raise"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def make_subprocess(cmdline, stdout\u003dFalse, stderr\u003dFalse, stdin\u003dFalse,"},{"line_number":58,"context_line":"                    universal_newlines\u003dFalse, close_fds\u003dTrue):"},{"line_number":59,"context_line":"    \"\"\"Make a subprocess according to the given command-line string"},{"line_number":60,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FXVM%3D","line":57,"updated":"2013-07-03 08:57:11.000000000","message":"Can we make this \u0027private\u0027 now? Or are they still being used somewhere?","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"},{"author":{"_account_id":7952,"name":"Euan Harris","email":"euan.harris@citrix.com","username":"euanh"},"change_message_id":"1f93857f0974579063481ec8f1dfe46e4ae8b812","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        raise"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def make_subprocess(cmdline, stdout\u003dFalse, stderr\u003dFalse, stdin\u003dFalse,"},{"line_number":58,"context_line":"                    universal_newlines\u003dFalse, close_fds\u003dTrue):"},{"line_number":59,"context_line":"    \"\"\"Make a subprocess according to the given command-line string"},{"line_number":60,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FXTg%3D","line":57,"in_reply_to":"AAAAPn%2F%2FXVM%3D","updated":"2013-07-03 09:02:42.000000000","message":"No, it\u0027s still being used in the migration plugin.","commit_id":"00253a12761c01e11bd0885e01a251fc1ea70414"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94bd87521a1d6fe0cae7eebed79db77adaa12d78","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    pass"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def _run_command(cmd, cmd_input\u003dNone):"},{"line_number":60,"context_line":"    \"\"\"Abstracts out the basics of issuing system commands. If the command"},{"line_number":61,"context_line":"    returns anything in stderr, a PluginError is raised with that information."},{"line_number":62,"context_line":"    Otherwise, the output from stdout is returned."}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAPn%2F%2Fnec%3D","line":59,"updated":"2013-06-26 17:10:36.000000000","message":"it might be worth moving this into utils.py. It can be shared with the one in xenstore.py","commit_id":"8d6171c2af184027d2110e4590ba3c20edf31ffb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94bd87521a1d6fe0cae7eebed79db77adaa12d78","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    process_input is passed to the process on standard input."},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":"    pipe \u003d subprocess.PIPE"},{"line_number":67,"context_line":"    proc \u003d subprocess.Popen(cmd, stdin\u003dpipe, stdout\u003dpipe, stderr\u003dpipe, "},{"line_number":68,"context_line":"                            close_fds\u003dTrue)"},{"line_number":69,"context_line":"    out, err \u003d proc.communicate(cmd_input)"},{"line_number":70,"context_line":"    if err:"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAPn%2F%2Fnh8%3D","line":67,"updated":"2013-06-26 17:10:36.000000000","message":"bit of whitespace here.\n\nI know shell\u003dfalse is the default, but part of me wants to see it. Hmm, its cleaner without that though.","commit_id":"8d6171c2af184027d2110e4590ba3c20edf31ffb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94bd87521a1d6fe0cae7eebed79db77adaa12d78","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    proc \u003d subprocess.Popen(cmd, stdin\u003dpipe, stdout\u003dpipe, stderr\u003dpipe, "},{"line_number":68,"context_line":"                            close_fds\u003dTrue)"},{"line_number":69,"context_line":"    out, err \u003d proc.communicate(cmd_input)"},{"line_number":70,"context_line":"    if err:"},{"line_number":71,"context_line":"        raise pluginlib.PluginError(err)"},{"line_number":72,"context_line":"    return out"},{"line_number":73,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAPn%2F%2FneQ%3D","line":70,"updated":"2013-06-26 17:10:36.000000000","message":"I think we should check proc.returncode too?","commit_id":"8d6171c2af184027d2110e4590ba3c20edf31ffb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"df4a0aca6fdcb74b77451d8bff35b179d7cd5105","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    pass"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def _run_command(cmd, cmd_input\u003dNone):"},{"line_number":62,"context_line":"    \"\"\"Abstracts out the basics of issuing system commands. If the command"},{"line_number":63,"context_line":"    returns anything in stderr, a PluginError is raised with that information."},{"line_number":64,"context_line":"    Otherwise, the output from stdout is returned."}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAPn%2F%2FiaA%3D","line":61,"updated":"2013-06-28 08:59:42.000000000","message":"I would move this to utils, and make everyone use it, if we can? Probably just needs an extra arg around the expected return values.","commit_id":"18ba6c2ab5d18064f4f159f8d613426470813793"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"df4a0aca6fdcb74b77451d8bff35b179d7cd5105","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        raise pluginlib.PluginError(result)"},{"line_number":118,"context_line":"    # Return the current enabled status"},{"line_number":119,"context_line":"    cmd \u003d [\"xe\", \"host-param-get\", \"uuid\u003d%s\" % host_uuid, \"param-name\u003denabled\"]"},{"line_number":120,"context_line":"    host_enabled \u003d _run_command(cmd)"},{"line_number":121,"context_line":"    if host_enabled \u003d\u003d \"true\":"},{"line_number":122,"context_line":"        status \u003d \"enabled\""},{"line_number":123,"context_line":"    else:"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAPn%2F%2FicI%3D","line":120,"updated":"2013-06-28 08:59:42.000000000","message":"Nice :)","commit_id":"18ba6c2ab5d18064f4f159f8d613426470813793"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"df4a0aca6fdcb74b77451d8bff35b179d7cd5105","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    returns anything in stderr, a PluginError is raised with that information."},{"line_number":204,"context_line":"    Otherwise, the output from stdout is returned."},{"line_number":205,"context_line":"    \"\"\""},{"line_number":206,"context_line":"    proc \u003d utils.make_subprocess(cmd, stdout\u003dTrue, stderr\u003dTrue, stdin\u003dTrue, close_fds\u003dTrue)"},{"line_number":207,"context_line":"    try:"},{"line_number":208,"context_line":"        out, err \u003d utils.finish_subprocess(proc, cmd)"},{"line_number":209,"context_line":"        return proc.returncode, out"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2Fibo%3D","line":206,"updated":"2013-06-28 08:59:42.000000000","message":"We should keep to 80 characters here too. I must raise a bug to start pep8 checking the plugins again.","commit_id":"18ba6c2ab5d18064f4f159f8d613426470813793"}]}
