)]}'
{"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"61041858374c05ff8a5ce3ea78981be77328ab75","unresolved":false,"context_lines":[{"line_number":3638,"context_line":"            mock_get_arch.return_value \u003d guest_arch"},{"line_number":3639,"context_line":"            guest \u003d vconfig.LibvirtConfigGuest()"},{"line_number":3640,"context_line":""},{"line_number":3641,"context_line":"            drvr._create_consoles(virt_type\u003d\"kvm\", guest\u003dguest, log_path\u003d\"\","},{"line_number":3642,"context_line":"                                  flavor\u003d{}, image_meta\u003d{}, caps\u003dcaps)"},{"line_number":3643,"context_line":"            self.assertEqual(2, len(guest.devices))"},{"line_number":3644,"context_line":"            console_device \u003d guest.devices[0]"},{"line_number":3645,"context_line":"            self.assertIsInstance(console_device, device_type)"},{"line_number":3646,"context_line":"            self.assertEqual(\"tcp\", console_device.type)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a629dbe_4c1a5618","line":3643,"range":{"start_line":3641,"start_character":0,"end_line":3643,"end_character":51},"updated":"2016-11-11 01:51:34.000000000","message":"we should add another check or tests for virt_type as \u0027parallels and make sure only 1 device present in guest.","commit_id":"f11188f17b1b8a71e7fde740e439673361c0e688"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"b63904c20c80c2fad73d491a458b4e773259295b","unresolved":false,"context_lines":[{"line_number":3638,"context_line":"            mock_get_arch.return_value \u003d guest_arch"},{"line_number":3639,"context_line":"            guest \u003d vconfig.LibvirtConfigGuest()"},{"line_number":3640,"context_line":""},{"line_number":3641,"context_line":"            drvr._create_consoles(virt_type\u003d\"kvm\", guest\u003dguest, log_path\u003d\"\","},{"line_number":3642,"context_line":"                                  flavor\u003d{}, image_meta\u003d{}, caps\u003dcaps)"},{"line_number":3643,"context_line":"            self.assertEqual(2, len(guest.devices))"},{"line_number":3644,"context_line":"            console_device \u003d guest.devices[0]"},{"line_number":3645,"context_line":"            self.assertIsInstance(console_device, device_type)"},{"line_number":3646,"context_line":"            self.assertEqual(\"tcp\", console_device.type)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a629dbe_31e644e8","line":3643,"range":{"start_line":3641,"start_character":0,"end_line":3643,"end_character":51},"in_reply_to":"9a629dbe_4c1a5618","updated":"2016-11-11 14:48:37.000000000","message":"@gmann: This is covered in test case \"test_get_guest_config_parallels_vm\" https://github.com/openstack/nova/blob/04f4945976c5ea69e99006b2a6d70ac5078a230f/nova/tests/unit/virt/libvirt/test_driver.py#L14748-L14781\n\nThe method \"get_guest_config\" calls \"_create_consoles\" and the test case explicitly checks for the number and types of devices.","commit_id":"f11188f17b1b8a71e7fde740e439673361c0e688"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"951197f9e0980ee18a8ea2be5ac0161309977f4c","unresolved":false,"context_lines":[{"line_number":4230,"context_line":"        else:"},{"line_number":4231,"context_line":"            guest.os_boot_dev \u003d blockinfo.get_boot_order(disk_info)"},{"line_number":4232,"context_line":""},{"line_number":4233,"context_line":"    def _create_consoles(self, virt_type, guest, instance, flavor, image_meta,"},{"line_number":4234,"context_line":"                         caps):"},{"line_number":4235,"context_line":"        if virt_type in (\"qemu\", \"kvm\"):"},{"line_number":4236,"context_line":"            # Create the serial console char devices"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_b8364ee5","line":4233,"range":{"start_line":4233,"start_character":8,"end_line":4233,"end_character":24},"updated":"2016-10-12 10:05:32.000000000","message":"This function takes a guest object and assigns consoles to it. As a follow up, what about renaming this to \u0027_add_consoles\u0027, which is more in line with what the function actually does?","commit_id":"62891546ca2d36120233ebc7369825f3abf2648a"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"8f3a6ae74ad69dd162033b275640a9ac0831b49b","unresolved":false,"context_lines":[{"line_number":4230,"context_line":"        else:"},{"line_number":4231,"context_line":"            guest.os_boot_dev \u003d blockinfo.get_boot_order(disk_info)"},{"line_number":4232,"context_line":""},{"line_number":4233,"context_line":"    def _create_consoles(self, virt_type, guest, instance, flavor, image_meta,"},{"line_number":4234,"context_line":"                         caps):"},{"line_number":4235,"context_line":"        if virt_type in (\"qemu\", \"kvm\"):"},{"line_number":4236,"context_line":"            # Create the serial console char devices"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_0e4b7088","line":4233,"range":{"start_line":4233,"start_character":8,"end_line":4233,"end_character":24},"in_reply_to":"fa6399be_b8364ee5","updated":"2016-10-12 11:21:19.000000000","message":"Yes, I\u0027d very much like to do that. I\u0027d also like to do a PoC how this would look like with a \"Strategy\" pattern implemented: https://industriallogic.com/xp/refactoring/conditionalWithStrategy.html\n\nBut that\u0027s probably a task for the Pike cycle. :-/","commit_id":"62891546ca2d36120233ebc7369825f3abf2648a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"43130d8e2bdd044a475607156653f5254ecaaece","unresolved":false,"context_lines":[{"line_number":4350,"context_line":"        else:"},{"line_number":4351,"context_line":"            consolepty \u003d vconfig.LibvirtConfigGuestConsole()"},{"line_number":4352,"context_line":""},{"line_number":4353,"context_line":"        if virt_type !\u003d \u0027parallels\u0027:"},{"line_number":4354,"context_line":"            consolepty.type \u003d \"pty\""},{"line_number":4355,"context_line":"            guest.add_device(consolepty)"},{"line_number":4356,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_b673937f","line":4353,"range":{"start_line":4353,"start_character":0,"end_line":4353,"end_character":36},"updated":"2016-11-09 13:01:29.000000000","message":"nit: could this be rewritten to exit early, like:\n\n    if virt_type \u003d\u003d \u0027parallels\u0027:\n        return\n\n    consolepty.type \u003d \u0027pty\u0027\n    guest.add_device(consolepty)\n\nThis makes it more readable, IMO","commit_id":"9ebdf2d3e157f743c1a39472c3b54b4239ce5757"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"5b1dcd4a61f38aa4a3834eb309ce3a240c6b90a2","unresolved":false,"context_lines":[{"line_number":4350,"context_line":"        else:"},{"line_number":4351,"context_line":"            consolepty \u003d vconfig.LibvirtConfigGuestConsole()"},{"line_number":4352,"context_line":""},{"line_number":4353,"context_line":"        if virt_type !\u003d \u0027parallels\u0027:"},{"line_number":4354,"context_line":"            consolepty.type \u003d \"pty\""},{"line_number":4355,"context_line":"            guest.add_device(consolepty)"},{"line_number":4356,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_36322311","line":4353,"range":{"start_line":4353,"start_character":0,"end_line":4353,"end_character":36},"in_reply_to":"9a629dbe_b673937f","updated":"2016-11-09 13:17:15.000000000","message":"@Stephen: Yes, this is part of a follow up patch I\u0027m working on. That patch has nothing to do with virtlogd anymore but plainly reshuffles the conditionals. My local first draft looks like this:\n\n    def _create_consoles(self, virt_type, guest, log_path, flavor, image_meta,\n                         caps):\n        if virt_type \u003d\u003d \u0027parallels\u0027:\n            pass\n        elif virt_type not in (\"qemu\", \"kvm\"):\n            consolepty \u003d vconfig.LibvirtConfigGuestConsole()\n            consolepty.type \u003d \"pty\"\n            guest.add_device(consolepty)\n        elif (virt_type in (\"qemu\", \"kvm\") and\n                      guest_arch in (arch.S390, arch.S390X)):\n            self._create_consoles_for_s390x(guest, log_path, flavor,\n                                            image_meta, caps,\n                                            is_serial_enabled,\n                                            is_virtlogd_available)\n        elif virt_type in (\"qemu\", \"kvm\"):\n            self._create_consoles_qemu_kvm(guest, log_path, flavor,\n                                           image_meta, caps,\n                                           is_serial_enabled,\n                                           is_virtlogd_available)\n        else:\n            LOG.debug(\"Unknown combination of virt_type and arch\")\n\n    def _create_consoles_qemu_kvm(self, guest, log_path, flavor, image_meta,\n                                  caps, is_serial_enabled,\n                                  is_virtlogd_available):\n        if is_serial_enabled and is_virtlogd_available:\n            pass\n        elif is_serial_enabled and not is_virtlogd_available:\n            pass\n        elif not is_serial_enabled and is_virtlogd_available:\n            pass\n        elif not is_serial_enabled and not is_virtlogd_available:\n            pass\n\n    def _create_consoles_for_s390x(self, guest, log_path, flavor, image_meta,\n                                   caps, is_serial_enabled,\n                                   is_virtlogd_available):\n        if is_serial_enabled and is_virtlogd_available:\n            pass\n        elif is_serial_enabled and not is_virtlogd_available:\n            pass\n        elif not is_serial_enabled and is_virtlogd_available:\n            pass\n        elif not is_serial_enabled and not is_virtlogd_available:\n            pass\n\nPROS: easier to read and extend/drop\nCONS: more code\n\nHopefully I can push a WIP by end of the week.","commit_id":"9ebdf2d3e157f743c1a39472c3b54b4239ce5757"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"291f1d518d55dec0c9bd95056752a8b7d8ba39eb","unresolved":false,"context_lines":[{"line_number":4302,"context_line":"            guest.os_boot_dev \u003d blockinfo.get_boot_order(disk_info)"},{"line_number":4303,"context_line":""},{"line_number":4304,"context_line":"    def _create_consoles(self, virt_type, guest, log_path, flavor, image_meta,"},{"line_number":4305,"context_line":"                         caps):"},{"line_number":4306,"context_line":"        if virt_type in (\"qemu\", \"kvm\"):"},{"line_number":4307,"context_line":"            # Create the serial console char devices"},{"line_number":4308,"context_line":"            guest_arch \u003d libvirt_utils.get_arch(image_meta)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_47affe80","line":4305,"updated":"2016-11-24 17:39:52.000000000","message":"Nit: tempting to add a doc about how this updates the guest object with the consoles that are created.","commit_id":"f11188f17b1b8a71e7fde740e439673361c0e688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"291f1d518d55dec0c9bd95056752a8b7d8ba39eb","unresolved":false,"context_lines":[{"line_number":4340,"context_line":"                consolelog.type \u003d \"file\""},{"line_number":4341,"context_line":"                consolelog.source_path \u003d log_path"},{"line_number":4342,"context_line":"                guest.add_device(consolelog)"},{"line_number":4343,"context_line":"            if caps.host.cpu.arch in (arch.S390, arch.S390X):"},{"line_number":4344,"context_line":"                consolepty \u003d vconfig.LibvirtConfigGuestConsole()"},{"line_number":4345,"context_line":"                consolepty.target_type \u003d \"sclp\""},{"line_number":4346,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_67d87a1e","line":4343,"updated":"2016-11-24 17:39:52.000000000","message":"Nit: and extra space here might help things, although honestly I would be tempted by starting a new if statement with \"if virt_type in (\"qemu\", \"kvm\"):\" again.","commit_id":"f11188f17b1b8a71e7fde740e439673361c0e688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"291f1d518d55dec0c9bd95056752a8b7d8ba39eb","unresolved":false,"context_lines":[{"line_number":4483,"context_line":""},{"line_number":4484,"context_line":"        guest.os_type \u003d (vm_mode.get_from_instance(instance) or"},{"line_number":4485,"context_line":"                self._get_guest_os_type(virt_type))"},{"line_number":4486,"context_line":"        caps \u003d self._host.get_capabilities()"},{"line_number":4487,"context_line":""},{"line_number":4488,"context_line":"        self._configure_guest_by_virt_type(guest, virt_type, caps, instance,"},{"line_number":4489,"context_line":"                                           image_meta, flavor,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_e7b48ad2","line":4486,"range":{"start_line":4486,"start_character":8,"end_line":4486,"end_character":12},"updated":"2016-11-24 17:39:52.000000000","message":"Nit: tempting to rename this host_caps so its clearer, but thats a different change.","commit_id":"f11188f17b1b8a71e7fde740e439673361c0e688"}]}
