)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"05e6f2c77b161827dc85ab54da4a821422a98561","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Andy Hill \u003chillad@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-03-18 12:30:13 -0500"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"enapi: Adding logging for migration plugin"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With this change administrators will be able to examine hypervisor"},{"line_number":10,"context_line":"logs for real-time progress of rsync operations (resizes, migrates)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAOH%2F%2F%2BmU%3D","line":7,"updated":"2013-03-18 18:33:03.000000000","message":"You dropped the \u0027x\u0027","commit_id":"1bff79c3a578399717896bd5aad0f9e8cac97957"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/migration":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"8424612a5d9b45e80e1acc234bd5805b7055b15a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":45,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":46,"context_line":"    line \u003d \u0027\u0027"},{"line_number":47,"context_line":"    while True:"},{"line_number":48,"context_line":"        output \u003d rsync_proc.stdout.read(1)"},{"line_number":49,"context_line":"        if not output:"},{"line_number":50,"context_line":"            break"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAM3%2F%2Blz4%3D","line":47,"updated":"2013-02-26 15:59:40.000000000","message":"Yup, reading like john suggests would be simpler and more efficient.","commit_id":"81901506ea71d99423a8a06584125d84a9bd4ed3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"20d4aab6dd0f1c6c32affd392350a0a25833a558","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":46,"context_line":"    line \u003d \u0027\u0027"},{"line_number":47,"context_line":"    while True:"},{"line_number":48,"context_line":"        output \u003d rsync_proc.stdout.read(1)"},{"line_number":49,"context_line":"        if not output:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        if output in [\u0027\\n\u0027, \u0027\\r\u0027]:"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAM3%2F%2Bl0s%3D","line":48,"updated":"2013-02-26 15:52:49.000000000","message":"would it not be easier with:\n\nfor line in rsync_proc.stdout:\n   logging.info(line)\n\nOr am I missing something?","commit_id":"81901506ea71d99423a8a06584125d84a9bd4ed3"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"8424612a5d9b45e80e1acc234bd5805b7055b15a","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            line \u003d \u0027\u0027"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            line +\u003d output"},{"line_number":56,"context_line":"        if rsync_proc.returncode:"},{"line_number":57,"context_line":"            print \"Return code found %s\" % rsync_proc.returncode"},{"line_number":58,"context_line":"            break"},{"line_number":59,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAM3%2F%2Blzs%3D","line":56,"updated":"2013-02-26 15:59:40.000000000","message":"I think you need to call poll() 1st to make sure the returncode attribute is set.","commit_id":"81901506ea71d99423a8a06584125d84a9bd4ed3"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"8424612a5d9b45e80e1acc234bd5805b7055b15a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            line +\u003d output"},{"line_number":56,"context_line":"        if rsync_proc.returncode:"},{"line_number":57,"context_line":"            print \"Return code found %s\" % rsync_proc.returncode"},{"line_number":58,"context_line":"            break"},{"line_number":59,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"},{"line_number":60,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":3,"id":"AAAAM3%2F%2Blz0%3D","line":57,"updated":"2013-02-26 15:59:40.000000000","message":"logging, not print. (or just delete the line, there\u0027s logging in finish_subprocess)","commit_id":"81901506ea71d99423a8a06584125d84a9bd4ed3"},{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"d73f6962ab769904652d2acbf356c9c589021187","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        if not output:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        if output in [\u0027\\n\u0027, \u0027\\r\u0027]:"},{"line_number":52,"context_line":"            logging.info(line)"},{"line_number":53,"context_line":"            line \u003d \u0027\u0027"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            line +\u003d output"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAANH%2F%2F8Ts%3D","line":52,"updated":"2013-03-02 03:28:06.000000000","message":"You are missing an import in order to be able to use logging.","commit_id":"866af214bf19afec1d0bd0e6e578dded0c67094e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f7464183a70e5708ba9f21aecb82d58169d00fa7","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        if not output:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        if output in [\u0027\\n\u0027, \u0027\\r\u0027]:"},{"line_number":52,"context_line":"            logging.info(line)"},{"line_number":53,"context_line":"            line \u003d \u0027\u0027"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            line +\u003d output"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAN3%2F%2F04o%3D","line":52,"in_reply_to":"AAAAN3%2F%2F%2FWI%3D","updated":"2013-03-11 10:52:00.000000000","message":"I don\u0027t see this as a blocker, but it would be nice to tidy up this code my starting to make the imports a bit more explicit. The \"import *\" does make this a bit \"magic\" at the moment. Not fault of yours Andy!","commit_id":"866af214bf19afec1d0bd0e6e578dded0c67094e"},{"author":{"_account_id":6687,"name":"Andy Hill","email":"hillad@gmail.com","username":"hillad"},"change_message_id":"3b297fb641895ebbe7f109c72caec77622b5bec6","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        if not output:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        if output in [\u0027\\n\u0027, \u0027\\r\u0027]:"},{"line_number":52,"context_line":"            logging.info(line)"},{"line_number":53,"context_line":"            line \u003d \u0027\u0027"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            line +\u003d output"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAN3%2F%2F%2FWI%3D","line":52,"in_reply_to":"AAAANH%2F%2F8Ts%3D","updated":"2013-03-04 14:19:57.000000000","message":"configure_logging handles this for you in the XenAPI plugins.\n\nhttps://github.com/openstack/nova/blob/master/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py","commit_id":"866af214bf19afec1d0bd0e6e578dded0c67094e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a29e90195a10e309765916d0a28d3baa20ca55e5","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":46,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":47,"context_line":"    while True:"},{"line_number":48,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":49,"context_line":"        if not rsync_progress:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        logging.info(rsync_progress)"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAN3%2F%2Ft1Q%3D","line":48,"updated":"2013-03-15 10:09:17.000000000","message":"Looks much better.\n\nDid \"for line in rsync_proc.stdout\" not work?","commit_id":"397e35137b74d72fb16a50dfc8a08eac11bd4c8a"},{"author":{"_account_id":6687,"name":"Andy Hill","email":"hillad@gmail.com","username":"hillad"},"change_message_id":"e63af25bf15eb2b02d68792ff1a0d8325ea60665","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":46,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":47,"context_line":"    while True:"},{"line_number":48,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":49,"context_line":"        if not rsync_progress:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        logging.info(rsync_progress)"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAN3%2F%2FtiE%3D","line":48,"in_reply_to":"AAAAN3%2F%2Ft1Q%3D","updated":"2013-03-17 20:48:49.000000000","message":"for line in rsync_proc.stdout blocked until the process had completed.","commit_id":"397e35137b74d72fb16a50dfc8a08eac11bd4c8a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a29e90195a10e309765916d0a28d3baa20ca55e5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        if not rsync_progress:"},{"line_number":50,"context_line":"            break"},{"line_number":51,"context_line":"        logging.info(rsync_progress)"},{"line_number":52,"context_line":"        time.sleep(1)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"},{"line_number":55,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAN3%2F%2Ft1M%3D","line":52,"updated":"2013-03-15 10:09:17.000000000","message":"Do we need this?","commit_id":"397e35137b74d72fb16a50dfc8a08eac11bd4c8a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"cc6c60168dd1da3f8791778287e5a32b333e28b1","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _rsync_vhds(instance_uuid, host, staging_path, user\u003d\"root\"):"},{"line_number":36,"context_line":"    ssh_cmd \u003d \u0027\\\"ssh -o StrictHostKeyChecking\u003dno\\\" \u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    if not staging_path.endswith(\u0027/\u0027):"},{"line_number":39,"context_line":"        staging_path +\u003d \u0027/\u0027"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B84%3D","line":36,"updated":"2013-03-18 14:43:10.000000000","message":"I would prefer that this space be left in the command below.  It seems strange to look for it up here.","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":6687,"name":"Andy Hill","email":"hillad@gmail.com","username":"hillad"},"change_message_id":"af4f5e6878b5609174aedced64b31d6674af0901","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _rsync_vhds(instance_uuid, host, staging_path, user\u003d\"root\"):"},{"line_number":36,"context_line":"    ssh_cmd \u003d \u0027\\\"ssh -o StrictHostKeyChecking\u003dno\\\" \u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    if not staging_path.endswith(\u0027/\u0027):"},{"line_number":39,"context_line":"        staging_path +\u003d \u0027/\u0027"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B6I%3D","line":36,"in_reply_to":"AAAAOH%2F%2F%2B84%3D","updated":"2013-03-18 17:29:38.000000000","message":"Done","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"cc6c60168dd1da3f8791778287e5a32b333e28b1","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":45,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":46,"context_line":"    while True:"},{"line_number":47,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":48,"context_line":"        if not rsync_progress:"},{"line_number":49,"context_line":"            break"},{"line_number":50,"context_line":"        logging.info(rsync_progress)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B8M%3D","line":47,"updated":"2013-03-18 14:43:10.000000000","message":"The Popen.communicate() method may be safer here.","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"2478298646a4d78b69dcbc2ca16c07bfe19e3a4b","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":45,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":46,"context_line":"    while True:"},{"line_number":47,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":48,"context_line":"        if not rsync_progress:"},{"line_number":49,"context_line":"            break"},{"line_number":50,"context_line":"        logging.info(rsync_progress)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2BqA%3D","line":47,"in_reply_to":"AAAAOH%2F%2F%2B6M%3D","updated":"2013-03-18 18:04:20.000000000","message":"Gotcha, I missed that in the description.  Because of the warnings about buffering issues I prefer to stick with subprocess methods for I/O but it looks like there\u0027s actually no method for achieving this.","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":6687,"name":"Andy Hill","email":"hillad@gmail.com","username":"hillad"},"change_message_id":"af4f5e6878b5609174aedced64b31d6674af0901","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"line_number":45,"context_line":"    rsync_proc \u003d utils.make_subprocess(rsync_cmd, stdout\u003dTrue, stderr\u003dTrue)"},{"line_number":46,"context_line":"    while True:"},{"line_number":47,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":48,"context_line":"        if not rsync_progress:"},{"line_number":49,"context_line":"            break"},{"line_number":50,"context_line":"        logging.info(rsync_progress)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B6M%3D","line":47,"in_reply_to":"AAAAOH%2F%2F%2B8M%3D","updated":"2013-03-18 17:29:38.000000000","message":"Popen.communicate() seems to require the process to be complete before giving the output. The goal of this was to be able to provide real time output for administrators to see how long a large file transfer is taking.\n\nI did a quick mockup here for testing\u0027s sake:\nhttps://gist.github.com/andyhky/f25abe3687df563793d0","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"cc6c60168dd1da3f8791778287e5a32b333e28b1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":48,"context_line":"        if not rsync_progress:"},{"line_number":49,"context_line":"            break"},{"line_number":50,"context_line":"        logging.info(rsync_progress)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"},{"line_number":53,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B8Q%3D","line":50,"updated":"2013-03-18 14:43:10.000000000","message":"I think debug would be better for this.  I have the feeling that this isn\u0027t going to look particularly good in the logs.  But I can be convinced either way on this.","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":6687,"name":"Andy Hill","email":"hillad@gmail.com","username":"hillad"},"change_message_id":"af4f5e6878b5609174aedced64b31d6674af0901","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":48,"context_line":"        if not rsync_progress:"},{"line_number":49,"context_line":"            break"},{"line_number":50,"context_line":"        logging.info(rsync_progress)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"},{"line_number":53,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOH%2F%2F%2B5Q%3D","line":50,"in_reply_to":"AAAAOH%2F%2F%2B8Q%3D","updated":"2013-03-18 17:29:38.000000000","message":"Done","commit_id":"920cc3cef6066f4bf6c3ff9f367dee656d0226d8"},{"author":{"_account_id":5044,"name":"Mate Lakat","email":"mlakat@suse.com","username":"mate-lakat"},"change_message_id":"8af81609fc535d3c0fac0ae2de1adcd1aeeb26e8","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)s \"\\"},{"line_number":44,"context_line":"        \"%(staging_path)s %(dest_path)s\" % locals()"},{"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":"AAAAOH%2F%2F9kI%3D","line":43,"updated":"2013-03-19 09:27:03.000000000","message":"I would rather make this logging magic optional. It is extra complexity.","commit_id":"3c0f4d0c3d17dd5e6746d286fda910750fba5f2f"},{"author":{"_account_id":5044,"name":"Mate Lakat","email":"mlakat@suse.com","username":"mate-lakat"},"change_message_id":"8af81609fc535d3c0fac0ae2de1adcd1aeeb26e8","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        rsync_progress \u003d rsync_proc.stdout.readline()"},{"line_number":53,"context_line":"        if not rsync_progress:"},{"line_number":54,"context_line":"            break"},{"line_number":55,"context_line":"        logging.debug(rsync_progress)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    utils.finish_subprocess(rsync_proc, rsync_cmd)"},{"line_number":58,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAOH%2F%2F9kM%3D","line":55,"updated":"2013-03-19 09:27:03.000000000","message":"The pid would be useful here, so that in case multiple migrations happen in the same time, you could distinguish between them.","commit_id":"3c0f4d0c3d17dd5e6746d286fda910750fba5f2f"}]}
