)]}'
{"nova/tests/unit/virt/zvm/test_driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ff1ef49cc1217045c3ed9f57bdf23a9dfa2a2c4e","unresolved":false,"context_lines":[{"line_number":494,"context_line":"    def test_instance_power_action(self, call):"},{"line_number":495,"context_line":"        call.side_effect \u003d [[\u0027test0001\u0027, \u0027test0002\u0027], None]"},{"line_number":496,"context_line":"        self.driver._instance_power_action(self._instance, \u0027guest_start\u0027)"},{"line_number":497,"context_line":"        call.assert_any_call(\u0027guest_list\u0027)"},{"line_number":498,"context_line":"        call.assert_any_call(\u0027guest_start\u0027, \u0027test0001\u0027)"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    @mock.patch(\u0027nova.virt.zvm.utils.zVMConnectorRequestHandler.call\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df7087c5_102571ab","line":497,"range":{"start_line":497,"start_character":13,"end_line":497,"end_character":28},"updated":"2018-03-21 20:54:10.000000000","message":"I\u0027m mildly offended by these assert_any_call()s.  We should be able to assert the calls in the proper order.  E.g. in this case:\n\n call.assert_has_calls([\n     mock.call(\u0027guest_list\u0027),\n     mock.call(\u0027guest_start\u0027, \u0027test0001\u0027)])","commit_id":"a11884d2e87a548013c27d557d2c179d7dc980c5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2fb693900daf7a6e91d484238b52a75044da9fc0","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self.flags(instance_name_template\u003d\u0027abc%6d\u0027)"},{"line_number":50,"context_line":"        self.assertRaises(exception.ZVMDriverException,"},{"line_number":51,"context_line":"                          self._driver._validate_options)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch(\u0027nova.virt.zvm.utils.zVMConnectorRequestHandler.call\u0027)"},{"line_number":54,"context_line":"    def test_guest_power_action(self, call):"},{"line_number":55,"context_line":"        call.side_effect \u003d [[\u0027test0001\u0027, \u0027test0002\u0027], None]"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_fc59c5fd","line":52,"updated":"2018-04-09 20:55:08.000000000","message":"Suddenly these tests are in test_driver rather than test_guestop.  I\u0027m not necessarily saying they should be moved; rather that perhaps the other ones should be.","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"858957bb63c176a5bb5274cc7b040521b3d62096","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self.flags(instance_name_template\u003d\u0027abc%6d\u0027)"},{"line_number":50,"context_line":"        self.assertRaises(exception.ZVMDriverException,"},{"line_number":51,"context_line":"                          self._driver._validate_options)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch(\u0027nova.virt.zvm.utils.zVMConnectorRequestHandler.call\u0027)"},{"line_number":54,"context_line":"    def test_guest_power_action(self, call):"},{"line_number":55,"context_line":"        call.side_effect \u003d [[\u0027test0001\u0027, \u0027test0002\u0027], None]"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_a8952034","line":52,"in_reply_to":"bf659307_c515dd4a","updated":"2018-04-11 07:40:03.000000000","message":"ok, maybe test both...","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a98bf52ecdad0b6e79a8f9566aa8ed7a4690363","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self.flags(instance_name_template\u003d\u0027abc%6d\u0027)"},{"line_number":50,"context_line":"        self.assertRaises(exception.ZVMDriverException,"},{"line_number":51,"context_line":"                          self._driver._validate_options)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch(\u0027nova.virt.zvm.utils.zVMConnectorRequestHandler.call\u0027)"},{"line_number":54,"context_line":"    def test_guest_power_action(self, call):"},{"line_number":55,"context_line":"        call.side_effect \u003d [[\u0027test0001\u0027, \u0027test0002\u0027], None]"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_c515dd4a","line":52,"in_reply_to":"bf659307_fc59c5fd","updated":"2018-04-11 07:23:25.000000000","message":"ok , maybe move some previous patch\u0027s test..","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"5a89ab174c227c90bbeb2415095e2cd7d6fd966d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":39,"id":"5f7c97a3_e2d25d5c","updated":"2018-05-10 01:43:49.000000000","message":"Missing unit tests for the \u0027instance_exists\u0027 method in the driver.","commit_id":"567355cf4f262e2b38fe3dd3c6785e2a1026adfd"}],"nova/virt/zvm/driver.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"18fdd226c4845a9f4c940a6b5cf9318ebc6ab19b","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        LOG.debug(\"Snapshot image upload complete\", instance\u003dinstance)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def _instance_power_action(self, instance, action, *args, **kwargs):"},{"line_number":423,"context_line":"        inst_name \u003d instance[\u0027name\u0027]"},{"line_number":424,"context_line":"        if self._instance_exists(inst_name):"},{"line_number":425,"context_line":"            LOG.info(_(\"Power action %(action)s to instance %(inst_name)s\"),"},{"line_number":426,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: inst_name},"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_a9d3ac5f","line":423,"range":{"start_line":423,"start_character":20,"end_line":423,"end_character":36},"updated":"2018-02-12 08:01:27.000000000","message":"we can use instance.name I geuss","commit_id":"cb83dd41d81e70a42971367d1b5ec65b7bd8e6fe"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"18fdd226c4845a9f4c940a6b5cf9318ebc6ab19b","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        self._instance_power_action(instance, \u0027guest_start\u0027)"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def pause(self, instance):"},{"line_number":448,"context_line":"        \"\"\"Pause the z/VM instance.\"\"\""},{"line_number":449,"context_line":"        self._instance_power_action(instance, \u0027guest_pause\u0027)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def unpause(self, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_e9bc5407","line":448,"range":{"start_line":448,"start_character":9,"end_line":448,"end_character":38},"updated":"2018-02-12 08:01:27.000000000","message":"nit: comment inconsistent to above functions","commit_id":"cb83dd41d81e70a42971367d1b5ec65b7bd8e6fe"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3d6aff3d961cbb4ae4506d84864933f8fdccfa49","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        LOG.debug(\"Snapshot image upload complete\", instance\u003dinstance)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def _instance_power_action(self, instance, action, *args, **kwargs):"},{"line_number":423,"context_line":"        inst_name \u003d instance.name"},{"line_number":424,"context_line":"        if self._instance_exists(inst_name):"},{"line_number":425,"context_line":"            LOG.info(_(\"Power action %(action)s to instance %(inst_name)s\"),"},{"line_number":426,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: inst_name},"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_b655d1fc","line":423,"range":{"start_line":423,"start_character":8,"end_line":423,"end_character":33},"updated":"2018-02-15 22:50:04.000000000","message":"It is not necessary. Just use instance.name instead of inst_name.","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":5930,"name":"Huang Rui","email":"bjhuangr@cn.ibm.com","username":"bjhuangr"},"change_message_id":"25795da298acd601d26005e56265a8a19ff563e7","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        LOG.debug(\"Snapshot image upload complete\", instance\u003dinstance)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def _instance_power_action(self, instance, action, *args, **kwargs):"},{"line_number":423,"context_line":"        inst_name \u003d instance.name"},{"line_number":424,"context_line":"        if self._instance_exists(inst_name):"},{"line_number":425,"context_line":"            LOG.info(_(\"Power action %(action)s to instance %(inst_name)s\"),"},{"line_number":426,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: inst_name},"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_8b6fb626","line":423,"range":{"start_line":423,"start_character":8,"end_line":423,"end_character":33},"in_reply_to":"3fa0c359_b655d1fc","updated":"2018-02-23 05:43:10.000000000","message":"Done","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3d6aff3d961cbb4ae4506d84864933f8fdccfa49","unresolved":false,"context_lines":[{"line_number":422,"context_line":"    def _instance_power_action(self, instance, action, *args, **kwargs):"},{"line_number":423,"context_line":"        inst_name \u003d instance.name"},{"line_number":424,"context_line":"        if self._instance_exists(inst_name):"},{"line_number":425,"context_line":"            LOG.info(_(\"Power action %(action)s to instance %(inst_name)s\"),"},{"line_number":426,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: inst_name},"},{"line_number":427,"context_line":"                     instance\u003dinstance)"},{"line_number":428,"context_line":"            self._reqh.call(action, inst_name, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_b6071119","line":425,"range":{"start_line":425,"start_character":21,"end_line":425,"end_character":23},"updated":"2018-02-15 22:50:04.000000000","message":"It is not necessary.","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":5930,"name":"Huang Rui","email":"bjhuangr@cn.ibm.com","username":"bjhuangr"},"change_message_id":"25795da298acd601d26005e56265a8a19ff563e7","unresolved":false,"context_lines":[{"line_number":422,"context_line":"    def _instance_power_action(self, instance, action, *args, **kwargs):"},{"line_number":423,"context_line":"        inst_name \u003d instance.name"},{"line_number":424,"context_line":"        if self._instance_exists(inst_name):"},{"line_number":425,"context_line":"            LOG.info(_(\"Power action %(action)s to instance %(inst_name)s\"),"},{"line_number":426,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: inst_name},"},{"line_number":427,"context_line":"                     instance\u003dinstance)"},{"line_number":428,"context_line":"            self._reqh.call(action, inst_name, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_4b676e4e","line":425,"range":{"start_line":425,"start_character":21,"end_line":425,"end_character":23},"in_reply_to":"3fa0c359_b6071119","updated":"2018-02-23 05:43:10.000000000","message":"Done","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"3d6aff3d961cbb4ae4506d84864933f8fdccfa49","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                     instance\u003dinstance)"},{"line_number":428,"context_line":"            self._reqh.call(action, inst_name, *args, **kwargs)"},{"line_number":429,"context_line":"        else:"},{"line_number":430,"context_line":"            LOG.warning(_(\u0027Instance %s does not exist\u0027), inst_name,"},{"line_number":431,"context_line":"                        instance\u003dinstance)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_76118953","line":430,"range":{"start_line":430,"start_character":24,"end_line":430,"end_character":26},"updated":"2018-02-15 22:50:04.000000000","message":"ditto","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":5930,"name":"Huang Rui","email":"bjhuangr@cn.ibm.com","username":"bjhuangr"},"change_message_id":"25795da298acd601d26005e56265a8a19ff563e7","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                     instance\u003dinstance)"},{"line_number":428,"context_line":"            self._reqh.call(action, inst_name, *args, **kwargs)"},{"line_number":429,"context_line":"        else:"},{"line_number":430,"context_line":"            LOG.warning(_(\u0027Instance %s does not exist\u0027), inst_name,"},{"line_number":431,"context_line":"                        instance\u003dinstance)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_0b5de677","line":430,"range":{"start_line":430,"start_character":24,"end_line":430,"end_character":26},"in_reply_to":"3fa0c359_76118953","updated":"2018-02-23 05:43:10.000000000","message":"Done","commit_id":"0cdc5adf0c3b8050bf72e99a3b904c3505a60845"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"7e150df4dd87862e6a2589a54599a43259f6a0a0","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        if self.instance_exists(instance):"},{"line_number":135,"context_line":"            LOG.info(\"Power action %(action)s to instance %(inst_name)s\","},{"line_number":136,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: instance.name},"},{"line_number":137,"context_line":"                     instance\u003dinstance)"},{"line_number":138,"context_line":"            self._hypervisor.guest_power_action(action, instance.name,"},{"line_number":139,"context_line":"                                                *args, **kwargs)"},{"line_number":140,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_a86e8bfd","line":137,"range":{"start_line":137,"start_character":30,"end_line":137,"end_character":38},"updated":"2018-04-10 22:31:23.000000000","message":"Name the instance once.","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a98bf52ecdad0b6e79a8f9566aa8ed7a4690363","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        if self.instance_exists(instance):"},{"line_number":135,"context_line":"            LOG.info(\"Power action %(action)s to instance %(inst_name)s\","},{"line_number":136,"context_line":"                     {\u0027action\u0027: action, \u0027inst_name\u0027: instance.name},"},{"line_number":137,"context_line":"                     instance\u003dinstance)"},{"line_number":138,"context_line":"            self._hypervisor.guest_power_action(action, instance.name,"},{"line_number":139,"context_line":"                                                *args, **kwargs)"},{"line_number":140,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_85104550","line":137,"range":{"start_line":137,"start_character":30,"end_line":137,"end_character":38},"in_reply_to":"bf659307_a86e8bfd","updated":"2018-04-11 07:23:25.000000000","message":"Done","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"7e150df4dd87862e6a2589a54599a43259f6a0a0","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                                                *args, **kwargs)"},{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            LOG.warning(\"Instance %s does not exist\", instance.name,"},{"line_number":142,"context_line":"                        instance\u003dinstance)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":145,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_6874f3cf","line":142,"updated":"2018-04-10 22:31:23.000000000","message":"Name the instance once.","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a98bf52ecdad0b6e79a8f9566aa8ed7a4690363","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                                                *args, **kwargs)"},{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            LOG.warning(\"Instance %s does not exist\", instance.name,"},{"line_number":142,"context_line":"                        instance\u003dinstance)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":145,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_4516ad4b","line":142,"in_reply_to":"bf659307_6874f3cf","updated":"2018-04-11 07:23:25.000000000","message":"Done","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2fb693900daf7a6e91d484238b52a75044da9fc0","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":145,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"},{"line_number":146,"context_line":"            self._guest_power_action(instance, \u0027guest_softstop\u0027,"},{"line_number":147,"context_line":"                                        timeout\u003dtimeout,"},{"line_number":148,"context_line":"                                        poll_interval\u003dretry_interval)"},{"line_number":149,"context_line":"        else:"},{"line_number":150,"context_line":"            self._guest_power_action(instance, \u0027guest_softstop\u0027)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_fc40e509","line":148,"range":{"start_line":146,"start_character":12,"end_line":148,"end_character":69},"updated":"2018-04-09 20:55:08.000000000","message":"These calls (containing the string name of the operation over the zvm connector) are misplaced. Following the pattern established a couple of patches ago, they should be in hypervisor.py; and the methods in this file should contain the extra logic like the instance_exists check, the timeout stuff in power_off, and the hard/soft reboot toggle.","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a98bf52ecdad0b6e79a8f9566aa8ed7a4690363","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":145,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"},{"line_number":146,"context_line":"            self._guest_power_action(instance, \u0027guest_softstop\u0027,"},{"line_number":147,"context_line":"                                        timeout\u003dtimeout,"},{"line_number":148,"context_line":"                                        poll_interval\u003dretry_interval)"},{"line_number":149,"context_line":"        else:"},{"line_number":150,"context_line":"            self._guest_power_action(instance, \u0027guest_softstop\u0027)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_452f8d87","line":148,"range":{"start_line":146,"start_character":12,"end_line":148,"end_character":69},"in_reply_to":"bf659307_fc40e509","updated":"2018-04-11 07:23:25.000000000","message":"I will modify the function into something like following:\n\n _guest \u003d guest.Guest(self._hypervisor, instance)\n _guest.guest_power_action(action, instance, *args, **kwargs)\n\nthanks :)","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c3f4e602846647dbe2d88489b5d95a66893ecd5b","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        _guest \u003d guest.Guest(self._hypervisor, instance)"},{"line_number":125,"context_line":"        _guest.snapshot(context, image_id, update_task_state)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _guest_power_action(self, instance, action, *args, **kwargs):"},{"line_number":128,"context_line":"        if self.instance_exists(instance):"},{"line_number":129,"context_line":"            LOG.info(\"Power action %(action)s to instance\", {\u0027action\u0027: action},"},{"line_number":130,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_eff473f3","line":127,"updated":"2018-04-11 15:06:16.000000000","message":"Again/still, we\u0027ve established the pattern of having the \u0027command_string\u0027 hidden in the guest.py or hypervisor.py modules.  We should maintain that pattern.\n\nSo what I would like to see is the hypervisor module having a separate method for each of the \u0027guest_*\u0027 operations, and these methods should invoke those as appropriate.\n\nI recognize that you don\u0027t want to duplicate the instance_exists logic in all of these methods.  You can refactor that into a method that just does the checking/logging and returns a bool (or if raises an exception, as suggested below, then you don\u0027t need it to return anything); and then call it from each of the power methods.","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f272a245ea310593bdc08b00fb3acc0243c0064a","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        _guest \u003d guest.Guest(self._hypervisor, instance)"},{"line_number":125,"context_line":"        _guest.snapshot(context, image_id, update_task_state)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _guest_power_action(self, instance, action, *args, **kwargs):"},{"line_number":128,"context_line":"        if self.instance_exists(instance):"},{"line_number":129,"context_line":"            LOG.info(\"Power action %(action)s to instance\", {\u0027action\u0027: action},"},{"line_number":130,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f6a8fd7_ea457316","line":127,"in_reply_to":"bf659307_eff473f3","updated":"2018-05-02 08:38:01.000000000","message":"I tend to remove the instance check now, because if instance is gone, actually we will get some error indication and anyway we will get a exception here, so no need to check now\n\nand I refactory the code so that we can follow the pattern , and have a hyeprvisor specific functions here as you mentioned, guest_xx for each operation","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c3f4e602846647dbe2d88489b5d95a66893ecd5b","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            _guest \u003d guest.Guest(self._hypervisor, instance)"},{"line_number":132,"context_line":"            _guest.guest_power_action(action, *args, **kwargs)"},{"line_number":133,"context_line":"        else:"},{"line_number":134,"context_line":"            LOG.warning(\"Instance does not exist\", instance\u003dinstance)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":137,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_8fddb771","line":134,"range":{"start_line":134,"start_character":12,"end_line":134,"end_character":69},"updated":"2018-04-11 15:06:16.000000000","message":"Hum, I think asking for a power action on a nonexistent instance should be an InstanceNotFound exception.","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f272a245ea310593bdc08b00fb3acc0243c0064a","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            _guest \u003d guest.Guest(self._hypervisor, instance)"},{"line_number":132,"context_line":"            _guest.guest_power_action(action, *args, **kwargs)"},{"line_number":133,"context_line":"        else:"},{"line_number":134,"context_line":"            LOG.warning(\"Instance does not exist\", instance\u003dinstance)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"},{"line_number":137,"context_line":"        if timeout \u003e\u003d 0 and retry_interval \u003e 0:"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f6a8fd7_8a54f7cb","line":134,"range":{"start_line":134,"start_character":12,"end_line":134,"end_character":69},"in_reply_to":"bf659307_8fddb771","updated":"2018-05-02 08:38:01.000000000","message":"as mentioned above, now no need to have this check","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2cc0d76c7222ac73b702bd79083c57ec3924e774","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def list_instances(self):"},{"line_number":80,"context_line":"        return self._hypervisor.list_names()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def instance_exists(self, instance):"},{"line_number":83,"context_line":"        try:"},{"line_number":84,"context_line":"            return instance.uuid in self.list_instance_uuids()"},{"line_number":85,"context_line":"        except NotImplementedError:"}],"source_content_type":"text/x-python","patch_set":48,"id":"5f7c97a3_0f05eb13","line":82,"updated":"2018-05-31 10:52:16.000000000","message":"What is the difference with method \u0027_exists_in_hypervisor()\u0027 ?","commit_id":"5031ed7a9cd5a7823565f5565288fbbb31bc756d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"eda3a83ed2951329a139f0e0829577b7a023b791","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    def list_instances(self):"},{"line_number":80,"context_line":"        return self._hypervisor.list_names()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def instance_exists(self, instance):"},{"line_number":83,"context_line":"        try:"},{"line_number":84,"context_line":"            return instance.uuid in self.list_instance_uuids()"},{"line_number":85,"context_line":"        except NotImplementedError:"}],"source_content_type":"text/x-python","patch_set":48,"id":"5f7c97a3_abf37908","line":82,"in_reply_to":"5f7c97a3_0f05eb13","updated":"2018-06-01 05:52:14.000000000","message":"I removed _exists_in_hypervisor() in previous patch based on Eric\u0027s comments, so it should be ok now\n\nthe reason is there\u0027s virt driver default implementation\nif we don\u0027t overwrite it , it might lead to some issue to us \n\nline 87 is difference here, we need to make sure it\u0027s upper case compare","commit_id":"5031ed7a9cd5a7823565f5565288fbbb31bc756d"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3753c2f61953530eca50c5c50482d47c1f5246f9","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def instance_exists(self, instance):"},{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            return instance.uuid in self.list_instance_uuids()"},{"line_number":92,"context_line":"        except NotImplementedError:"},{"line_number":93,"context_line":"            # z/VM driver returns name in upper case"},{"line_number":94,"context_line":"            return instance.name.upper() in self.list_instances()"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_493b15e9","line":91,"range":{"start_line":91,"start_character":36,"end_line":91,"end_character":62},"updated":"2018-06-11 10:20:17.000000000","message":"I might have missed something. But I would have added a TODO or a comment explaining why this is not implemented. Also if that is never going to be implemented so that check is not necessary, right?","commit_id":"30297453e96e60bccf7ba93da2fc3e1f59f1961a"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"c36020dc34193b4662dc846831fa328247dcf9c5","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def instance_exists(self, instance):"},{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            return instance.uuid in self.list_instance_uuids()"},{"line_number":92,"context_line":"        except NotImplementedError:"},{"line_number":93,"context_line":"            # z/VM driver returns name in upper case"},{"line_number":94,"context_line":"            return instance.name.upper() in self.list_instances()"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_ec3d4f2c","line":91,"range":{"start_line":91,"start_character":36,"end_line":91,"end_character":62},"in_reply_to":"5f7c97a3_493b15e9","updated":"2018-06-11 10:52:59.000000000","message":"yes, I removed the check and added some comments here, thanks","commit_id":"30297453e96e60bccf7ba93da2fc3e1f59f1961a"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"9702007c815f109bcdda946632d677a4e44f1dd6","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def instance_exists(self, instance):"},{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            return instance.uuid in self.list_instance_uuids()"},{"line_number":92,"context_line":"        except NotImplementedError:"},{"line_number":93,"context_line":"            # z/VM driver returns name in upper case"},{"line_number":94,"context_line":"            return instance.name.upper() in self.list_instances()"}],"source_content_type":"text/x-python","patch_set":52,"id":"5f7c97a3_79356844","line":91,"range":{"start_line":91,"start_character":36,"end_line":91,"end_character":62},"in_reply_to":"5f7c97a3_ec3d4f2c","updated":"2018-06-12 08:26:50.000000000","message":"Cool thanks.","commit_id":"30297453e96e60bccf7ba93da2fc3e1f59f1961a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"03cfffacdc506103d9cfee1ccf13081df0e28b0f","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def instance_exists(self, instance):"},{"line_number":89,"context_line":"        # z/VM driver returns name in upper case and because userid is"},{"line_number":90,"context_line":"        # stored instead of uuid, list_instance_uuids is not implemented"},{"line_number":91,"context_line":"        return instance.name.upper() in self.list_instances()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def get_available_resource(self, nodename\u003dNone):"},{"line_number":94,"context_line":"        host_stats \u003d self._hypervisor.get_available_resource()"}],"source_content_type":"text/x-python","patch_set":57,"id":"5f7c97a3_b72df246","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":61},"updated":"2018-07-11 14:29:25.000000000","message":"you can call this method directly https://review.openstack.org/#/c/527658/58/nova/virt/zvm/hypervisor.py@73","commit_id":"be35ab44a26166c0cc88d4e0840c9a76a244d2ac"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2ecec3550c2b113151bd77515854628ce26e4aba","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def instance_exists(self, instance):"},{"line_number":89,"context_line":"        # z/VM driver returns name in upper case and because userid is"},{"line_number":90,"context_line":"        # stored instead of uuid, list_instance_uuids is not implemented"},{"line_number":91,"context_line":"        return instance.name.upper() in self.list_instances()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def get_available_resource(self, nodename\u003dNone):"},{"line_number":94,"context_line":"        host_stats \u003d self._hypervisor.get_available_resource()"}],"source_content_type":"text/x-python","patch_set":57,"id":"5f7c97a3_773afae6","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":61},"in_reply_to":"5f7c97a3_b72df246","updated":"2018-07-11 14:41:39.000000000","message":"++","commit_id":"be35ab44a26166c0cc88d4e0840c9a76a244d2ac"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"365df0641865158a9584c2e333c14f245d45d4f4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def instance_exists(self, instance):"},{"line_number":89,"context_line":"        # z/VM driver returns name in upper case and because userid is"},{"line_number":90,"context_line":"        # stored instead of uuid, list_instance_uuids is not implemented"},{"line_number":91,"context_line":"        return instance.name.upper() in self.list_instances()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def get_available_resource(self, nodename\u003dNone):"},{"line_number":94,"context_line":"        host_stats \u003d self._hypervisor.get_available_resource()"}],"source_content_type":"text/x-python","patch_set":57,"id":"5f7c97a3_f37dac6d","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":61},"in_reply_to":"5f7c97a3_b72df246","updated":"2018-07-12 06:45:33.000000000","message":"Done","commit_id":"be35ab44a26166c0cc88d4e0840c9a76a244d2ac"}],"nova/virt/zvm/guest.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c3f4e602846647dbe2d88489b5d95a66893ecd5b","unresolved":false,"context_lines":[{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        LOG.debug(\"Snapshot image upload complete\", instance\u003dinstance)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def guest_power_action(self, action, *args, **kwargs):"},{"line_number":305,"context_line":"        self._hypervisor.guest_power_action(action, self._instance.name,"},{"line_number":306,"context_line":"                                            *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_f415264a","line":304,"updated":"2018-04-11 15:06:16.000000000","message":"I would get rid of this.","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f272a245ea310593bdc08b00fb3acc0243c0064a","unresolved":false,"context_lines":[{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        LOG.debug(\"Snapshot image upload complete\", instance\u003dinstance)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def guest_power_action(self, action, *args, **kwargs):"},{"line_number":305,"context_line":"        self._hypervisor.guest_power_action(action, self._instance.name,"},{"line_number":306,"context_line":"                                            *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f6a8fd7_4a601fa6","line":304,"in_reply_to":"bf659307_f415264a","updated":"2018-05-02 08:38:01.000000000","message":"Done","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"}],"nova/virt/zvm/hypervisor.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2fb693900daf7a6e91d484238b52a75044da9fc0","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":115,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def guest_power_action(self, action, name, *args, **kwargs):"},{"line_number":118,"context_line":"        self._reqh.call(action, name, *args, **kwargs)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def image_query(self, imagename):"},{"line_number":121,"context_line":"        return self._reqh.call(\u0027image_query\u0027, imagename\u003dimagename)"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_3c05fdc2","line":118,"range":{"start_line":117,"start_character":0,"end_line":118,"end_character":54},"updated":"2018-04-09 20:55:08.000000000","message":"Did you notice that this is now a generic method that can be used to call *any* of the connector methods (including those defined in the rest of the methods in this class)?\n\nSee note in driver.py.","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a98bf52ecdad0b6e79a8f9566aa8ed7a4690363","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":115,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def guest_power_action(self, action, name, *args, **kwargs):"},{"line_number":118,"context_line":"        self._reqh.call(action, name, *args, **kwargs)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def image_query(self, imagename):"},{"line_number":121,"context_line":"        return self._reqh.call(\u0027image_query\u0027, imagename\u003dimagename)"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_a81e805c","line":118,"range":{"start_line":117,"start_character":0,"end_line":118,"end_character":54},"in_reply_to":"bf659307_3c05fdc2","updated":"2018-04-11 07:23:25.000000000","message":"yes, guess a follow up patch will do some enhancement\n\nnow the patches might be easier to be reviewed if we kept those functions (above and below)","commit_id":"0a1cbec647cc708ffe5389e7fd7666369761084d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c3f4e602846647dbe2d88489b5d95a66893ecd5b","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":115,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def guest_power_action(self, action, name, *args, **kwargs):"},{"line_number":118,"context_line":"        self._reqh.call(action, name, *args, **kwargs)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def image_query(self, imagename):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_9425cac4","line":117,"updated":"2018-04-11 15:06:16.000000000","message":"I still don\u0027t like this being so generic.  I know it\u0027s a bit of an explosion of similar methods, but we should do it anyway: follow the pattern of the other methods in this module and make a separate one per \u0027command_string\u0027.","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f272a245ea310593bdc08b00fb3acc0243c0064a","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":115,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def guest_power_action(self, action, name, *args, **kwargs):"},{"line_number":118,"context_line":"        self._reqh.call(action, name, *args, **kwargs)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def image_query(self, imagename):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f6a8fd7_2a5dabe8","line":117,"in_reply_to":"bf659307_9425cac4","updated":"2018-05-02 08:38:01.000000000","message":"yes, I did it in next patch","commit_id":"c81028e8b5701935b339c104104f08983ffcc48f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2cc0d76c7222ac73b702bd79083c57ec3924e774","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":131,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def guest_softstop(self, name, timeout\u003d0, retry_interval\u003d0):"},{"line_number":134,"context_line":"        self._reqh.call(\u0027guest_softstop\u0027, name, timeout\u003dtimeout,"},{"line_number":135,"context_line":"                        poll_interval\u003dretry_interval)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"5f7c97a3_ea03bd0b","line":133,"updated":"2018-05-31 10:52:16.000000000","message":"Please add test for the methods. It\u0027s basically same kind of tests we do in test_guest.py","commit_id":"5031ed7a9cd5a7823565f5565288fbbb31bc756d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"eda3a83ed2951329a139f0e0829577b7a023b791","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    def guest_capture(self, name, image_id):"},{"line_number":131,"context_line":"        self._reqh.call(\u0027guest_capture\u0027, name, image_id)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def guest_softstop(self, name, timeout\u003d0, retry_interval\u003d0):"},{"line_number":134,"context_line":"        self._reqh.call(\u0027guest_softstop\u0027, name, timeout\u003dtimeout,"},{"line_number":135,"context_line":"                        poll_interval\u003dretry_interval)"},{"line_number":136,"context_line":""}],"source_content_type":"text/x-python","patch_set":48,"id":"5f7c97a3_6bd9e180","line":133,"in_reply_to":"5f7c97a3_ea03bd0b","updated":"2018-06-01 05:52:14.000000000","message":"right, will add","commit_id":"5031ed7a9cd5a7823565f5565288fbbb31bc756d"}]}
