)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"361af05fa9a80741947ccfd41dae508c7e907d32","unresolved":false,"context_lines":[{"line_number":18,"context_line":"exception. As the former is valid for multiple virt drivers, I\u0027m going"},{"line_number":19,"context_line":"to use that expectation."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"blueprint libvirt-virtlogd"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ic3c22b96937a836dbc50b7ce3b2ba1a864450180"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1aa78d24_518686db","line":21,"updated":"2016-07-06 16:51:03.000000000","message":"Please remove this.","commit_id":"3ab88a7b54c774c62e84c222ec10d2fc06723038"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"404a408b4b1bf4483dc58068784fe2241bc8ccb3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"exception. As the former is valid for multiple virt drivers, I\u0027m going"},{"line_number":19,"context_line":"to use that expectation."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1611380"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ic3c22b96937a836dbc50b7ce3b2ba1a864450180"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"9ad45d7e_2b32a610","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":20},"updated":"2016-08-10 09:37:23.000000000","message":"sdague wasn\u0027t fond of the idea of using a bug report for that, see https://bugs.launchpad.net/nova/+bug/1611380/comments/1\nI remove it in ps13.","commit_id":"80e704f5b9d8f308548b6eacee9f6087515b38af"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"985b43c546185f27a2aed751ffc085cd7fec8091","unresolved":false,"context_lines":[{"line_number":12,"context_line":"have the \"console.log\" file and depend on the flushing of the pty"},{"line_number":13,"context_line":"device. This is clarified now."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The unit tests \"virt/test_virt_drivers.py\" and \"libvirt/test_driver.py\""},{"line_number":16,"context_line":"had contradicting expectations when the \"console.log\" file is not"},{"line_number":17,"context_line":"available. The former expects a six.string_type, the latter expects an"},{"line_number":18,"context_line":"exception. As the former is valid for multiple virt drivers, I\u0027m going"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"ba5da102_89adfe8a","line":15,"range":{"start_line":15,"start_character":21,"end_line":15,"end_character":38},"updated":"2016-10-26 14:25:52.000000000","message":"I\u0027m not sure how much I trust test_virt_drivers as a virt API contract, I think a lot of those tests only run against libvirt.\n\nThe compute manager expects ConsoleNotAvailable so it\u0027s find to return that:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py#n4406\n\nAnd the API will handle it:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/console_output.py#n60\n\nYou get a 404 rather than an empty console output.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7efc44802111eddc5acd653aa9777c35e3974b74","unresolved":false,"context_lines":[{"line_number":12,"context_line":"have the \"console.log\" file and depend on the flushing of the pty"},{"line_number":13,"context_line":"device. This is clarified now."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The unit tests \"virt/test_virt_drivers.py\" and \"libvirt/test_driver.py\""},{"line_number":16,"context_line":"had contradicting expectations when the \"console.log\" file is not"},{"line_number":17,"context_line":"available. The former expects a six.string_type, the latter expects an"},{"line_number":18,"context_line":"exception. As the former is valid for multiple virt drivers, I\u0027m going"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"9a629dbe_2b5eb145","line":15,"range":{"start_line":15,"start_character":21,"end_line":15,"end_character":38},"in_reply_to":"ba5da102_89adfe8a","updated":"2016-11-07 10:33:08.000000000","message":"@Matt: Makes sense, I\u0027ll use the ConsoleNotAvailable again in the next ps.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"15b070354cea4e4364d75489607efa6ee568950d","unresolved":false,"context_lines":[{"line_number":2620,"context_line":"                # XEN guests, for example, don\u0027t have a \"console.log\" file"},{"line_number":2621,"context_line":"                return self._get_pty_output(instance)"},{"line_number":2622,"context_line":"            else:"},{"line_number":2623,"context_line":"                return \u0027\u0027"},{"line_number":2624,"context_line":""},{"line_number":2625,"context_line":"        self._chown_console_log_for_instance(instance)"},{"line_number":2626,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_0ab9d779","line":2623,"updated":"2016-06-28 12:25:18.000000000","message":"I think I\u0027d suggest structuring things slightly differently, so we don\u0027t do the console.log check for non-qemu/kvm.\neg\n\n def get_console_output:\n     if CONF.libvirt.virt_type in (qemu, kvm):\n          return self._get_console_output_file(instance)\n     else if CONF.libvirt.virt_type \u003d\u003d \"xen\":\n          return self._get_console_output_pty(instnace)\n     else:\n          return \"\"","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"cc9a804ab3999cd69929c53a6986cb4b153a7b01","unresolved":false,"context_lines":[{"line_number":2620,"context_line":"                # XEN guests, for example, don\u0027t have a \"console.log\" file"},{"line_number":2621,"context_line":"                return self._get_pty_output(instance)"},{"line_number":2622,"context_line":"            else:"},{"line_number":2623,"context_line":"                return \u0027\u0027"},{"line_number":2624,"context_line":""},{"line_number":2625,"context_line":"        self._chown_console_log_for_instance(instance)"},{"line_number":2626,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_cd4c09a0","line":2623,"in_reply_to":"3aaa91ec_0ab9d779","updated":"2016-06-28 12:44:01.000000000","message":"Done","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"15b070354cea4e4364d75489607efa6ee568950d","unresolved":false,"context_lines":[{"line_number":2621,"context_line":"                return self._get_pty_output(instance)"},{"line_number":2622,"context_line":"            else:"},{"line_number":2623,"context_line":"                return \u0027\u0027"},{"line_number":2624,"context_line":""},{"line_number":2625,"context_line":"        self._chown_console_log_for_instance(instance)"},{"line_number":2626,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"},{"line_number":2627,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_aa81a391","line":2624,"updated":"2016-06-28 12:25:18.000000000","message":"Now start\n\n    def _get_console_output_file()","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"cc9a804ab3999cd69929c53a6986cb4b153a7b01","unresolved":false,"context_lines":[{"line_number":2621,"context_line":"                return self._get_pty_output(instance)"},{"line_number":2622,"context_line":"            else:"},{"line_number":2623,"context_line":"                return \u0027\u0027"},{"line_number":2624,"context_line":""},{"line_number":2625,"context_line":"        self._chown_console_log_for_instance(instance)"},{"line_number":2626,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"},{"line_number":2627,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_4d72d9e4","line":2624,"in_reply_to":"3aaa91ec_aa81a391","updated":"2016-06-28 12:44:01.000000000","message":"Done","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"15b070354cea4e4364d75489607efa6ee568950d","unresolved":false,"context_lines":[{"line_number":2632,"context_line":"                         instance\u003dinstance)"},{"line_number":2633,"context_line":"            return log_data"},{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    def _get_pty_output(self, instance):"},{"line_number":2636,"context_line":"        guest \u003d self._host.get_guest(instance)"},{"line_number":2637,"context_line":""},{"line_number":2638,"context_line":"        xml \u003d guest.get_xml_desc()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_ca650f1e","line":2635,"updated":"2016-06-28 12:25:18.000000000","message":"Rename to _get_console_output_pty()","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"cc9a804ab3999cd69929c53a6986cb4b153a7b01","unresolved":false,"context_lines":[{"line_number":2632,"context_line":"                         instance\u003dinstance)"},{"line_number":2633,"context_line":"            return log_data"},{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    def _get_pty_output(self, instance):"},{"line_number":2636,"context_line":"        guest \u003d self._host.get_guest(instance)"},{"line_number":2637,"context_line":""},{"line_number":2638,"context_line":"        xml \u003d guest.get_xml_desc()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_cdbec963","line":2635,"in_reply_to":"3aaa91ec_ca650f1e","updated":"2016-06-28 12:44:01.000000000","message":"Done","commit_id":"df3aa9efe5d6b869689644667dce604f406f9626"},{"author":{"_account_id":22511,"name":"Anthony PERARD","email":"anthony.perard@gmail.com"},"change_message_id":"f8a706a4e8824a7a353cc9b78fb02beb12a5f28e","unresolved":false,"context_lines":[{"line_number":2625,"context_line":"                                 \u0027iflag\u003dnonblock\u0027,"},{"line_number":2626,"context_line":"                                 run_as_root\u003dTrue,"},{"line_number":2627,"context_line":"                                 check_exit_code\u003dFalse)"},{"line_number":2628,"context_line":"        return out"},{"line_number":2629,"context_line":""},{"line_number":2630,"context_line":"    def _append_to_file(self, data, fpath):"},{"line_number":2631,"context_line":"        LOG.info(_LI(\u0027data: %(data)r, fpath: %(fpath)r\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_bcb09144","side":"PARENT","line":2628,"range":{"start_line":2628,"start_character":0,"end_line":2628,"end_character":18},"updated":"2016-06-29 12:01:52.000000000","message":"You should probably keep the \"return out\" ;-).","commit_id":"a5dae110fbeb0bd7ada607967fad9bb8cfba66ea"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"2654a2fb0f1b3a95a7567d826b73a51dd216920b","unresolved":false,"context_lines":[{"line_number":2625,"context_line":"                                 \u0027iflag\u003dnonblock\u0027,"},{"line_number":2626,"context_line":"                                 run_as_root\u003dTrue,"},{"line_number":2627,"context_line":"                                 check_exit_code\u003dFalse)"},{"line_number":2628,"context_line":"        return out"},{"line_number":2629,"context_line":""},{"line_number":2630,"context_line":"    def _append_to_file(self, data, fpath):"},{"line_number":2631,"context_line":"        LOG.info(_LI(\u0027data: %(data)r, fpath: %(fpath)r\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_f1c23a52","side":"PARENT","line":2628,"range":{"start_line":2628,"start_character":0,"end_line":2628,"end_character":18},"in_reply_to":"3aaa91ec_1c956532","updated":"2016-06-29 14:02:14.000000000","message":"yep, will do","commit_id":"a5dae110fbeb0bd7ada607967fad9bb8cfba66ea"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"4be1358bdd76c97485a4a57a84c85e2e110f2977","unresolved":false,"context_lines":[{"line_number":2625,"context_line":"                                 \u0027iflag\u003dnonblock\u0027,"},{"line_number":2626,"context_line":"                                 run_as_root\u003dTrue,"},{"line_number":2627,"context_line":"                                 check_exit_code\u003dFalse)"},{"line_number":2628,"context_line":"        return out"},{"line_number":2629,"context_line":""},{"line_number":2630,"context_line":"    def _append_to_file(self, data, fpath):"},{"line_number":2631,"context_line":"        LOG.info(_LI(\u0027data: %(data)r, fpath: %(fpath)r\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_1c956532","side":"PARENT","line":2628,"range":{"start_line":2628,"start_character":0,"end_line":2628,"end_character":18},"in_reply_to":"3aaa91ec_bcb09144","updated":"2016-06-29 12:03:51.000000000","message":"Guess we\u0027re also missing a unit test to verify this :-)","commit_id":"a5dae110fbeb0bd7ada607967fad9bb8cfba66ea"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"2654a2fb0f1b3a95a7567d826b73a51dd216920b","unresolved":false,"context_lines":[{"line_number":2625,"context_line":"                                 \u0027iflag\u003dnonblock\u0027,"},{"line_number":2626,"context_line":"                                 run_as_root\u003dTrue,"},{"line_number":2627,"context_line":"                                 check_exit_code\u003dFalse)"},{"line_number":2628,"context_line":"        return out"},{"line_number":2629,"context_line":""},{"line_number":2630,"context_line":"    def _append_to_file(self, data, fpath):"},{"line_number":2631,"context_line":"        LOG.info(_LI(\u0027data: %(data)r, fpath: %(fpath)r\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_9632cc5c","side":"PARENT","line":2628,"range":{"start_line":2628,"start_character":0,"end_line":2628,"end_character":18},"in_reply_to":"3aaa91ec_bcb09144","updated":"2016-06-29 14:02:14.000000000","message":"dang it, I\u0027ve wasted hours for that...\nThanks Anthony!","commit_id":"a5dae110fbeb0bd7ada607967fad9bb8cfba66ea"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"021533ec8037ffb48f7a020104ff9fc8fe843076","unresolved":false,"context_lines":[{"line_number":2665,"context_line":"            if pty_path:"},{"line_number":2666,"context_line":"                break"},{"line_number":2667,"context_line":""},{"line_number":2668,"context_line":"        data \u003d self._flush_libvirt_console(pty_path)"},{"line_number":2669,"context_line":"        return data or \u0027\u0027"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"    def get_host_ip_addr(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_74df200d","line":2668,"updated":"2016-06-30 13:04:42.000000000","message":"I\u0027d say the output is always a string , no? At least if we want to be a little bit more concise.\n\n  return self._flush_libvirt_console(pty_path) or \u0027\u0027","commit_id":"30496eaff11733ba382aaa415423a20e04e475a0"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"ddf88949a7fd9686fab98fcfbe45cea26f423c28","unresolved":false,"context_lines":[{"line_number":2665,"context_line":"            if pty_path:"},{"line_number":2666,"context_line":"                break"},{"line_number":2667,"context_line":""},{"line_number":2668,"context_line":"        data \u003d self._flush_libvirt_console(pty_path)"},{"line_number":2669,"context_line":"        return data or \u0027\u0027"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"    def get_host_ip_addr(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_b7cfca27","line":2668,"in_reply_to":"3aaa91ec_74df200d","updated":"2016-06-30 13:22:54.000000000","message":"@sahid: Yeah, if I get [1] right, it will always be at least an empty string and never None. I\u0027m going to push a follow up patch for that. I don\u0027t wanna lose the +2 on today\u0027s FF.\n\nReferences:\n[1] https://github.com/openstack/oslo.concurrency/blob/c876fabd0726b33a34f72a1af7588da0360ae37f/oslo_concurrency/processutils.py#L394","commit_id":"30496eaff11733ba382aaa415423a20e04e475a0"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"9c1bfb15fcbbd8d151e77bd69c13fd83aae4665d","unresolved":false,"context_lines":[{"line_number":2665,"context_line":"            if pty_path:"},{"line_number":2666,"context_line":"                break"},{"line_number":2667,"context_line":""},{"line_number":2668,"context_line":"        data \u003d self._flush_libvirt_console(pty_path)"},{"line_number":2669,"context_line":"        return data or \u0027\u0027"},{"line_number":2670,"context_line":""},{"line_number":2671,"context_line":"    def get_host_ip_addr(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_3a574127","line":2668,"in_reply_to":"3aaa91ec_b7cfca27","updated":"2016-06-30 13:40:01.000000000","message":"The review for that is https://review.openstack.org/#/c/336021/","commit_id":"30496eaff11733ba382aaa415423a20e04e475a0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e0c3ff26463dc3c6c394b1819a0a2817ed996614","unresolved":false,"context_lines":[{"line_number":2677,"context_line":"                    continue"},{"line_number":2678,"context_line":"                break"},{"line_number":2679,"context_line":"        else:"},{"line_number":2680,"context_line":"            raise exception.ConsoleNotAvailable()"},{"line_number":2681,"context_line":""},{"line_number":2682,"context_line":"        console_log \u003d self._get_console_log_path(instance)"},{"line_number":2683,"context_line":"        # By default libvirt chowns the console log when it starts a domain."}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_84610e3c","side":"PARENT","line":2680,"updated":"2016-10-12 17:09:30.000000000","message":"Referring to this bit here.","commit_id":"1a30fda13ae78f4e40b848cacbf6278a359a91cb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"dc1930287065f7da815bfb78a7d4bf791bd1c282","unresolved":false,"context_lines":[{"line_number":2619,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2620,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2621,"context_line":"        else:"},{"line_number":2622,"context_line":"            return \u0027\u0027"},{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2625,"context_line":"        console_log \u003d self._get_console_log_path(instance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_4e3c88e2","line":2622,"updated":"2016-10-12 17:09:04.000000000","message":"Didn\u0027t we use to raise exception.ConsoleNotAvailable()?","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"3f6f4619260d3898aca4619d5ca6cc0f8ead09eb","unresolved":false,"context_lines":[{"line_number":2619,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2620,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2621,"context_line":"        else:"},{"line_number":2622,"context_line":"            return \u0027\u0027"},{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2625,"context_line":"        console_log \u003d self._get_console_log_path(instance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_ad3979d9","line":2622,"in_reply_to":"fa6399be_4e3c88e2","updated":"2016-10-13 09:28:52.000000000","message":"@John: True. There are contradicting expectations in \"libvirt.test_driver\" and \"virt.test_virt_drivers\":\n\nhttps://github.com/openstack/nova/blob/8e989bd9d5123caa58f442681c2bd321a19cec66/nova/tests/unit/virt/libvirt/test_driver.py#L10839\n\nhttps://github.com/openstack/nova/blob/8e989bd9d5123caa58f442681c2bd321a19cec66/nova/tests/unit/virt/test_virt_drivers.py#L587-L587\n\nAs mentioned in the commit message, I\u0027ve chosen to use the expectation from the test_virt_drivers test case, as it appeared to me that this is the expectation for all virt drivers.","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"67d78ec1e246d509a075d2f6a37eebf6e68a994e","unresolved":false,"context_lines":[{"line_number":2619,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2620,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2621,"context_line":"        else:"},{"line_number":2622,"context_line":"            return \u0027\u0027"},{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2625,"context_line":"        console_log \u003d self._get_console_log_path(instance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_b8444b1b","line":2622,"in_reply_to":"fa6399be_ad3979d9","updated":"2016-10-13 13:59:47.000000000","message":"Hm... but that could be the reason why the xen ci complains: \n\nTraceback (most recent call last):\n  File \"tempest/api/compute/servers/test_server_actions.py\", line 482, in test_get_console_output_server_id_in_shutoff_status\n    self.wait_for(self._get_output)\n  File \"tempest/api/compute/base.py\", line 273, in wait_for\n    condition()\n  File \"tempest/api/compute/servers/test_server_actions.py\", line 429, in _get_output\n    self.assertTrue(output, \"Console output was empty.\")\n  File \"/opt/stack/new/tempest/.tox/tempest/local/lib/python2.7/site-packages/unittest2/case.py\", line 702, in assertTrue\n    raise self.failureException(msg)\nAssertionError: u\u0027\u0027 is not true : Console output was empty.","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"63c8ce9960306a498bc542e810db1898c7a7aa36","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"        # By default libvirt chowns the console log when it starts a domain."},{"line_number":2630,"context_line":"        # We need to chown it back before attempting to read from or write"},{"line_number":2631,"context_line":"        # to it."},{"line_number":2632,"context_line":"        if os.path.exists(console_log):"},{"line_number":2633,"context_line":"            libvirt_utils.chown(console_log, os.getuid())"},{"line_number":2634,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"},{"line_number":2635,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp,"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_f3570400","line":2632,"range":{"start_line":2632,"start_character":8,"end_line":2632,"end_character":39},"updated":"2016-10-12 11:44:53.000000000","message":"sorry, missed that first, what\u0027s the reason to double check that file exists?","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"0684e432299671c50251a0344b3d6d753233586c","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"        # By default libvirt chowns the console log when it starts a domain."},{"line_number":2630,"context_line":"        # We need to chown it back before attempting to read from or write"},{"line_number":2631,"context_line":"        # to it."},{"line_number":2632,"context_line":"        if os.path.exists(console_log):"},{"line_number":2633,"context_line":"            libvirt_utils.chown(console_log, os.getuid())"},{"line_number":2634,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"},{"line_number":2635,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp,"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_7219ead6","line":2632,"range":{"start_line":2632,"start_character":8,"end_line":2632,"end_character":39},"in_reply_to":"fa6399be_16b8e6e4","updated":"2016-10-13 15:43:20.000000000","message":"I\u0027ll fix that in ps19. The rebase to ps18 was a mistake.","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"3316ffa9b584790db8b1135c797b6add854109ea","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"        # By default libvirt chowns the console log when it starts a domain."},{"line_number":2630,"context_line":"        # We need to chown it back before attempting to read from or write"},{"line_number":2631,"context_line":"        # to it."},{"line_number":2632,"context_line":"        if os.path.exists(console_log):"},{"line_number":2633,"context_line":"            libvirt_utils.chown(console_log, os.getuid())"},{"line_number":2634,"context_line":"        with libvirt_utils.file_open(console_log, \u0027rb\u0027) as fp:"},{"line_number":2635,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp,"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_16b8e6e4","line":2632,"range":{"start_line":2632,"start_character":8,"end_line":2632,"end_character":39},"in_reply_to":"fa6399be_f3570400","updated":"2016-10-12 12:11:37.000000000","message":"No reason, just a mistake. Good catch.","commit_id":"eaa1aca56170df13916fac8755b140406a1b10a2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"43f48d2c4e749e7f9da0a96fbb064f4a95aaf17b","unresolved":false,"context_lines":[{"line_number":2700,"context_line":"            libvirt_utils.chown(console_log, os.getuid())"},{"line_number":2701,"context_line":""},{"line_number":2702,"context_line":"        data \u003d self._flush_libvirt_console(pty)"},{"line_number":2703,"context_line":"        fpath \u003d self._append_to_file(data, console_log)"},{"line_number":2704,"context_line":""},{"line_number":2705,"context_line":"        with libvirt_utils.file_open(fpath, \u0027rb\u0027) as fp:"},{"line_number":2706,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp, MAX_CONSOLE_BYTES)"},{"line_number":2707,"context_line":"            if remaining \u003e 0:"},{"line_number":2708,"context_line":"                LOG.info(_LI(\u0027Truncated console log returned, \u0027"},{"line_number":2709,"context_line":"                             \u0027%d bytes ignored\u0027),"},{"line_number":2710,"context_line":"                         remaining, instance\u003dinstance)"},{"line_number":2711,"context_line":"            return log_data"},{"line_number":2712,"context_line":""},{"line_number":2713,"context_line":"    def get_host_ip_addr(self):"},{"line_number":2714,"context_line":"        ips \u003d compute_utils.get_machine_ips()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba5da102_49f926c8","side":"PARENT","line":2711,"range":{"start_line":2703,"start_character":8,"end_line":2711,"end_character":27},"updated":"2016-10-26 14:21:25.000000000","message":"Why don\u0027t we do this stuff for the pty type anymore?","commit_id":"e6c4d5641da77220d64b67ef4b5fe54e5b5f15e7"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7efc44802111eddc5acd653aa9777c35e3974b74","unresolved":false,"context_lines":[{"line_number":2700,"context_line":"            libvirt_utils.chown(console_log, os.getuid())"},{"line_number":2701,"context_line":""},{"line_number":2702,"context_line":"        data \u003d self._flush_libvirt_console(pty)"},{"line_number":2703,"context_line":"        fpath \u003d self._append_to_file(data, console_log)"},{"line_number":2704,"context_line":""},{"line_number":2705,"context_line":"        with libvirt_utils.file_open(fpath, \u0027rb\u0027) as fp:"},{"line_number":2706,"context_line":"            log_data, remaining \u003d utils.last_bytes(fp, MAX_CONSOLE_BYTES)"},{"line_number":2707,"context_line":"            if remaining \u003e 0:"},{"line_number":2708,"context_line":"                LOG.info(_LI(\u0027Truncated console log returned, \u0027"},{"line_number":2709,"context_line":"                             \u0027%d bytes ignored\u0027),"},{"line_number":2710,"context_line":"                         remaining, instance\u003dinstance)"},{"line_number":2711,"context_line":"            return log_data"},{"line_number":2712,"context_line":""},{"line_number":2713,"context_line":"    def get_host_ip_addr(self):"},{"line_number":2714,"context_line":"        ips \u003d compute_utils.get_machine_ips()"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a629dbe_6081a88f","side":"PARENT","line":2711,"range":{"start_line":2703,"start_character":8,"end_line":2711,"end_character":27},"in_reply_to":"ba5da102_49f926c8","updated":"2016-11-07 10:33:08.000000000","message":"@Matt: The initial thought was that this is not needed anymore when we return the flushed content of the pty device. After investing more thought I think we would introduce a bug when we remove line 2703. This line ensures that subsequent calls of the console output will contain everything, instead of the last time it got flushed. The next ps will still make use of the \"_append_to_file\" method to ensure that the output doesn\u0027t get truncated. Thanks for noticing that.","commit_id":"e6c4d5641da77220d64b67ef4b5fe54e5b5f15e7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"43f48d2c4e749e7f9da0a96fbb064f4a95aaf17b","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"    def get_console_output(self, context, instance):"},{"line_number":2630,"context_line":"        if CONF.libvirt.virt_type in (\"qemu\", \"kvm\"):"},{"line_number":2631,"context_line":"            return self._get_console_output_file(instance)"},{"line_number":2632,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2633,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2634,"context_line":"        else:"},{"line_number":2635,"context_line":"            return \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba5da102_496846bb","line":2632,"range":{"start_line":2632,"start_character":40,"end_line":2632,"end_character":43},"updated":"2016-10-26 14:21:25.000000000","message":"What about lxc, uml, and/or parallels? I\u0027m having a hard time finding out where any of the supported combinations are documented in the libvirt domain xml docs here:\n\nhttps://libvirt.org/formatdomain.html","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7efc44802111eddc5acd653aa9777c35e3974b74","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"    def get_console_output(self, context, instance):"},{"line_number":2630,"context_line":"        if CONF.libvirt.virt_type in (\"qemu\", \"kvm\"):"},{"line_number":2631,"context_line":"            return self._get_console_output_file(instance)"},{"line_number":2632,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2633,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2634,"context_line":"        else:"},{"line_number":2635,"context_line":"            return \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a629dbe_2b72317d","line":2632,"range":{"start_line":2632,"start_character":40,"end_line":2632,"end_character":43},"in_reply_to":"ba5da102_496846bb","updated":"2016-11-07 10:33:08.000000000","message":"@Matt: Reading https://github.com/openstack/nova/blob/0132cc8c2663843a891e054d9185e6ba2fd589ad/nova/virt/libvirt/driver.py#L4351-L4352 again makes me believe they also depend on the flushing of the pty device. At least these virt_types create a pty device and the code in \"get_console_output\" doesn\u0027t exclude them from the \"flush_libvirt_console\" logic. This means line 2632 is a mistake right now. Thanks for noticing that.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"43f48d2c4e749e7f9da0a96fbb064f4a95aaf17b","unresolved":false,"context_lines":[{"line_number":2632,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2633,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2634,"context_line":"        else:"},{"line_number":2635,"context_line":"            return \u0027\u0027"},{"line_number":2636,"context_line":""},{"line_number":2637,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2638,"context_line":"        console_log \u003d self._get_console_log_path(instance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba5da102_4913e65c","line":2635,"updated":"2016-10-26 14:21:25.000000000","message":"Why doesn\u0027t this return ConsoleNotAvailable now? That\u0027s what used to happen if there was no file or pty console.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7efc44802111eddc5acd653aa9777c35e3974b74","unresolved":false,"context_lines":[{"line_number":2632,"context_line":"        elif CONF.libvirt.virt_type \u003d\u003d \"xen\":"},{"line_number":2633,"context_line":"            return self._get_console_output_pty(instance)"},{"line_number":2634,"context_line":"        else:"},{"line_number":2635,"context_line":"            return \u0027\u0027"},{"line_number":2636,"context_line":""},{"line_number":2637,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2638,"context_line":"        console_log \u003d self._get_console_log_path(instance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a629dbe_2b26b116","line":2635,"in_reply_to":"ba5da102_4913e65c","updated":"2016-11-07 10:33:08.000000000","message":"My assumption was that the logic in \"test_virt_drivers\" is the more generic one, and that test module expects an empty string. But as you pointed out in the review of the commit message, the compute manager expects the ConsoleNotAvailable exception, so I will raise that exception in the next ps.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"43f48d2c4e749e7f9da0a96fbb064f4a95aaf17b","unresolved":false,"context_lines":[{"line_number":2637,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2638,"context_line":"        console_log \u003d self._get_console_log_path(instance)"},{"line_number":2639,"context_line":"        if not os.path.exists(console_log):"},{"line_number":2640,"context_line":"            return \u0027\u0027"},{"line_number":2641,"context_line":""},{"line_number":2642,"context_line":"        # By default libvirt chowns the console log when it starts a domain."},{"line_number":2643,"context_line":"        # We need to chown it back before attempting to read from or write"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba5da102_e903da0b","line":2640,"updated":"2016-10-26 14:21:25.000000000","message":"Didn\u0027t this condition use to log this?\n\nLOG.info(_LI(\u0027Instance is configured with a file console, \u0027\n                                 \u0027but the backing file is not (yet?) present\u0027),\n                             instance\u003dinstance)","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7efc44802111eddc5acd653aa9777c35e3974b74","unresolved":false,"context_lines":[{"line_number":2637,"context_line":"    def _get_console_output_file(self, instance):"},{"line_number":2638,"context_line":"        console_log \u003d self._get_console_log_path(instance)"},{"line_number":2639,"context_line":"        if not os.path.exists(console_log):"},{"line_number":2640,"context_line":"            return \u0027\u0027"},{"line_number":2641,"context_line":""},{"line_number":2642,"context_line":"        # By default libvirt chowns the console log when it starts a domain."},{"line_number":2643,"context_line":"        # We need to chown it back before attempting to read from or write"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a629dbe_cbc0d5e3","line":2640,"in_reply_to":"ba5da102_e903da0b","updated":"2016-11-07 10:33:08.000000000","message":"@Matt: True. In one of the older patchsets here we came to the conclusion that this log message (+ the one in lines 2677+2708) aren\u0027t that helpful. The operators don\u0027t have any chance to fix that IMO. I can add them again if you like.","commit_id":"84123e5366db9dabd189832147ad0bd583dc82a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"96f1ecadcbc348467ea63699e7d3da8b92513df5","unresolved":false,"context_lines":[{"line_number":2656,"context_line":"        file_device \u003d tree.find(\"./devices/console[@type\u003d\u0027file\u0027]\")"},{"line_number":2657,"context_line":"        if file_device is not None:"},{"line_number":2658,"context_line":"            source_node \u003d file_device.find(\u0027./source\u0027)"},{"line_number":2659,"context_line":"            path \u003d source_node.get(\"path\")"},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":"            if not os.path.exists(path):"},{"line_number":2662,"context_line":"                LOG.info(_LI(\u0027Instance is configured with a file console, \u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a629dbe_0ec0dbdf","line":2659,"updated":"2016-11-08 14:22:41.000000000","message":"This used to check if source_node was None, why don\u0027t we need that check anymore? Same for path.","commit_id":"5c1a82ebc398ac794e76aa252a18f204d657a414"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"e400ec17494b58d75f1cbb154ada37702397d5b4","unresolved":false,"context_lines":[{"line_number":2656,"context_line":"        file_device \u003d tree.find(\"./devices/console[@type\u003d\u0027file\u0027]\")"},{"line_number":2657,"context_line":"        if file_device is not None:"},{"line_number":2658,"context_line":"            source_node \u003d file_device.find(\u0027./source\u0027)"},{"line_number":2659,"context_line":"            path \u003d source_node.get(\"path\")"},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":"            if not os.path.exists(path):"},{"line_number":2662,"context_line":"                LOG.info(_LI(\u0027Instance is configured with a file console, \u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a629dbe_7455a64e","line":2659,"in_reply_to":"9a629dbe_0ec0dbdf","updated":"2016-11-08 15:52:45.000000000","message":"I removed too much. I\u0027ll revert that in ps 21.","commit_id":"5c1a82ebc398ac794e76aa252a18f204d657a414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4ebfe3171b0ab1d0e224af4d96659a2d2e341587","unresolved":false,"context_lines":[{"line_number":2678,"context_line":"        # Try \u0027pty\u0027 types"},{"line_number":2679,"context_line":"        pty_device \u003d tree.find(\"./devices/console[@type\u003d\u0027pty\u0027]\")"},{"line_number":2680,"context_line":"        if pty_device is not None:"},{"line_number":2681,"context_line":"            source_node \u003d pty_device.find(\u0027./source\u0027)"},{"line_number":2682,"context_line":"            pty \u003d source_node.get(\"path\")"},{"line_number":2683,"context_line":"        else:"},{"line_number":2684,"context_line":"            raise exception.ConsoleNotAvailable()"},{"line_number":2685,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9a629dbe_0e1c5b76","line":2682,"range":{"start_line":2681,"start_character":12,"end_line":2682,"end_character":41},"updated":"2016-11-08 14:23:59.000000000","message":"same here","commit_id":"5c1a82ebc398ac794e76aa252a18f204d657a414"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"e400ec17494b58d75f1cbb154ada37702397d5b4","unresolved":false,"context_lines":[{"line_number":2678,"context_line":"        # Try \u0027pty\u0027 types"},{"line_number":2679,"context_line":"        pty_device \u003d tree.find(\"./devices/console[@type\u003d\u0027pty\u0027]\")"},{"line_number":2680,"context_line":"        if pty_device is not None:"},{"line_number":2681,"context_line":"            source_node \u003d pty_device.find(\u0027./source\u0027)"},{"line_number":2682,"context_line":"            pty \u003d source_node.get(\"path\")"},{"line_number":2683,"context_line":"        else:"},{"line_number":2684,"context_line":"            raise exception.ConsoleNotAvailable()"},{"line_number":2685,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9a629dbe_f4c7f60f","line":2682,"range":{"start_line":2681,"start_character":12,"end_line":2682,"end_character":41},"in_reply_to":"9a629dbe_0e1c5b76","updated":"2016-11-08 15:52:45.000000000","message":"I removed too much. I\u0027ll revert that in ps 21.","commit_id":"5c1a82ebc398ac794e76aa252a18f204d657a414"}]}
