)]}'
{"nova/api/openstack/common.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"34cdc19d29798d8f6328599b9e06f6c3b38c8c34","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    vm_states.ACTIVE: {"},{"line_number":60,"context_line":"        \u0027default\u0027: \u0027ACTIVE\u0027,"},{"line_number":61,"context_line":"        task_states.REBOOTING: \u0027REBOOT\u0027,"},{"line_number":62,"context_line":"        task_states.REBOOT_PENDING: \u0027REBOOT\u0027,"},{"line_number":63,"context_line":"        task_states.REBOOT_STARTED: \u0027REBOOT\u0027,"},{"line_number":64,"context_line":"        task_states.REBOOTING_HARD: \u0027HARD_REBOOT\u0027,"},{"line_number":65,"context_line":"        task_states.REBOOT_PENDING_HARD: \u0027HARD_REBOOT\u0027,"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVX%2F%2FuXc%3D","line":62,"updated":"2014-02-28 18:53:44.000000000","message":"totally missed this, whoops.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"}],"nova/compute/api.py":[{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"738c459121382d781c8d64615d4424e8d9837199","unresolved":false,"context_lines":[{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"    @wrap_check_policy"},{"line_number":2055,"context_line":"    @check_instance_lock"},{"line_number":2056,"context_line":"    @check_instance_state(vm_state\u003dvm_states.ALLOW_HARD_REBOOT,"},{"line_number":2057,"context_line":"                          task_state\u003d[None, task_states.REBOOTING,"},{"line_number":2058,"context_line":"                                      task_states.REBOOTING_HARD,"},{"line_number":2059,"context_line":"                                      task_states.RESUMING,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9hWk%3D","line":2056,"updated":"2014-02-06 10:40:17.000000000","message":"vm_states\u003dset(vm_state\u003dvm_states.ALLOW_HARD_REBOOT, vm_state\u003dvm_states.ALLOW_SOFT_REBOOT)  would mean that you don\u0027t have to depend on ALLOW_HARD_REBOOT being a superset of ALLOW_SOFT_REBOOT)","commit_id":"5fc186dc110d67d8a9791ccc6bcf5cd0248d31b6"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"c34e4bd77daed0727acca1a22336e86070447528","unresolved":false,"context_lines":[{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"    @wrap_check_policy"},{"line_number":2055,"context_line":"    @check_instance_lock"},{"line_number":2056,"context_line":"    @check_instance_state(vm_state\u003dvm_states.ALLOW_HARD_REBOOT,"},{"line_number":2057,"context_line":"                          task_state\u003d[None, task_states.REBOOTING,"},{"line_number":2058,"context_line":"                                      task_states.REBOOTING_HARD,"},{"line_number":2059,"context_line":"                                      task_states.RESUMING,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9hLQ%3D","line":2056,"in_reply_to":"AAAAUH%2F9hWk%3D","updated":"2014-02-06 10:59:39.000000000","message":"Done","commit_id":"5fc186dc110d67d8a9791ccc6bcf5cd0248d31b6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":2040,"context_line":"    @wrap_check_policy"},{"line_number":2041,"context_line":"    @check_instance_lock"},{"line_number":2042,"context_line":"    @check_instance_state(vm_state\u003dset("},{"line_number":2043,"context_line":"                    vm_states.ALLOW_SOFT_REBOOT + vm_states.ALLOW_HARD_REBOOT),"},{"line_number":2044,"context_line":"                          task_state\u003d[None, task_states.REBOOTING,"},{"line_number":2045,"context_line":"                                      task_states.REBOOTING_HARD,"},{"line_number":2046,"context_line":"                                      task_states.RESUMING,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2Ffpc%3D","line":2043,"updated":"2014-02-26 10:30:49.000000000","message":"This seems a bit odd. But having ALLOW_HARD_REBOOT here, feels worse. I am good with this.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":2050,"context_line":"    def reboot(self, context, instance, reboot_type):"},{"line_number":2051,"context_line":"        \"\"\"Reboot the given instance.\"\"\""},{"line_number":2052,"context_line":"        if (reboot_type \u003d\u003d \u0027SOFT\u0027 and"},{"line_number":2053,"context_line":"                (instance[\u0027vm_state\u0027] in [vm_states.STOPPED,"},{"line_number":2054,"context_line":"                                          vm_states.PAUSED,"},{"line_number":2055,"context_line":"                                          vm_states.SUSPENDED,"},{"line_number":2056,"context_line":"                                          vm_states.ERROR])):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FfYc%3D","line":2053,"updated":"2014-02-26 10:30:49.000000000","message":"Minor nit, could this not be, if not in allow_soft_reboot, if not in allow_hard_reboot?\n\nAnyways, its not worth blocking this change on that.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"a517a362a3e3bafea266dfed2a46c1e3d20066eb","unresolved":false,"context_lines":[{"line_number":2050,"context_line":"    def reboot(self, context, instance, reboot_type):"},{"line_number":2051,"context_line":"        \"\"\"Reboot the given instance.\"\"\""},{"line_number":2052,"context_line":"        if (reboot_type \u003d\u003d \u0027SOFT\u0027 and"},{"line_number":2053,"context_line":"                (instance[\u0027vm_state\u0027] in [vm_states.STOPPED,"},{"line_number":2054,"context_line":"                                          vm_states.PAUSED,"},{"line_number":2055,"context_line":"                                          vm_states.SUSPENDED,"},{"line_number":2056,"context_line":"                                          vm_states.ERROR])):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FerA%3D","line":2053,"in_reply_to":"AAAAU3%2F%2FfYc%3D","updated":"2014-02-26 15:09:27.000000000","message":"Done","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":2040,"context_line":"    @wrap_check_policy"},{"line_number":2041,"context_line":"    @check_instance_lock"},{"line_number":2042,"context_line":"    @check_instance_state(vm_state\u003dset("},{"line_number":2043,"context_line":"                    vm_states.ALLOW_SOFT_REBOOT + vm_states.ALLOW_HARD_REBOOT),"},{"line_number":2044,"context_line":"                          task_state\u003d[None, task_states.REBOOTING,"},{"line_number":2045,"context_line":"                                      task_states.REBOOTING_HARD,"},{"line_number":2046,"context_line":"                                      task_states.RESUMING,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa8I%3D","line":2043,"updated":"2014-02-26 18:50:01.000000000","message":"So, this is just my opinion, but I don\u0027t like that we\u0027re losing immediate visibility here. Now, I have to go look in another file to see what is allowed for this case. Further, changes to that file would have implications here, but wouldn\u0027t be obvious during a review to someone that didn\u0027t remember this linkage.","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":2040,"context_line":"    @wrap_check_policy"},{"line_number":2041,"context_line":"    @check_instance_lock"},{"line_number":2042,"context_line":"    @check_instance_state(vm_state\u003dset("},{"line_number":2043,"context_line":"                    vm_states.ALLOW_SOFT_REBOOT + vm_states.ALLOW_HARD_REBOOT),"},{"line_number":2044,"context_line":"                          task_state\u003d[None, task_states.REBOOTING,"},{"line_number":2045,"context_line":"                                      task_states.REBOOTING_HARD,"},{"line_number":2046,"context_line":"                                      task_states.RESUMING,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F7n8%3D","line":2043,"in_reply_to":"AAAAU3%2F%2Fa8I%3D","updated":"2014-02-27 09:48:49.000000000","message":"I suppose the thinking here is that if you\u0027re making a change to which states allow reboot then you\u0027ll be impacting how this method functions whether you think to change it or not so it\u0027s best to be able to change that value in one place.","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"}],"nova/compute/manager.py":[{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"2c0c7ea7c9bb3e9510d2f6f864da4a91bc1d734f","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                                   task_state\u003dNone, vm_state\u003dvm_states.ACTIVE)"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED,"},{"line_number":682,"context_line":"                             task_states.REBOOT_PENDING]"},{"line_number":683,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if (instance.vm_state \u003d\u003d vm_states.ACTIVE and"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BjJ4%3D","line":682,"updated":"2013-11-24 07:29:30.000000000","message":"the alignment here could be better.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1a7c14f5ac44f910e41a6b4b72d16519aa2db14a","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                                   task_state\u003dNone, vm_state\u003dvm_states.ACTIVE)"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED,"},{"line_number":682,"context_line":"                             task_states.REBOOT_PENDING]"},{"line_number":683,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if (instance.vm_state \u003d\u003d vm_states.ACTIVE and"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BH0Y%3D","line":682,"in_reply_to":"AAAATn%2F%2BjJ4%3D","updated":"2013-12-02 13:31:32.000000000","message":"Done","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"2c0c7ea7c9bb3e9510d2f6f864da4a91bc1d734f","unresolved":false,"context_lines":[{"line_number":689,"context_line":"                        \"start-up and power state is (%(power_state)s), \""},{"line_number":690,"context_line":"                        \"retriggering reboot as it never started\"),"},{"line_number":691,"context_line":"                        {\u0027task_state\u0027: instance[\u0027task_state\u0027],"},{"line_number":692,"context_line":"                        \u0027power_state\u0027: current_power_state},"},{"line_number":693,"context_line":"                        instance\u003dinstance)"},{"line_number":694,"context_line":"            self.compute_rpcapi.reboot_instance(context, instance,"},{"line_number":695,"context_line":"                                                block_device_info\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BjJ0%3D","line":692,"updated":"2013-11-24 07:29:30.000000000","message":"alignment.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1a7c14f5ac44f910e41a6b4b72d16519aa2db14a","unresolved":false,"context_lines":[{"line_number":689,"context_line":"                        \"start-up and power state is (%(power_state)s), \""},{"line_number":690,"context_line":"                        \"retriggering reboot as it never started\"),"},{"line_number":691,"context_line":"                        {\u0027task_state\u0027: instance[\u0027task_state\u0027],"},{"line_number":692,"context_line":"                        \u0027power_state\u0027: current_power_state},"},{"line_number":693,"context_line":"                        instance\u003dinstance)"},{"line_number":694,"context_line":"            self.compute_rpcapi.reboot_instance(context, instance,"},{"line_number":695,"context_line":"                                                block_device_info\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BHw0%3D","line":692,"in_reply_to":"AAAATn%2F%2BjJ0%3D","updated":"2013-12-02 13:31:32.000000000","message":"Done","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"2c0c7ea7c9bb3e9510d2f6f864da4a91bc1d734f","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                            instance\u003dinstance)"},{"line_number":707,"context_line":"                instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":708,"context_line":"                                                 task_state\u003dNone,"},{"line_number":709,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE)"},{"line_number":710,"context_line":"            else:"},{"line_number":711,"context_line":"                LOG.debug(_(\"Instance in transitional state (%(task_state)s) \""},{"line_number":712,"context_line":"                            \"at start-up and power state is (%(power_state)s)\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BjKE%3D","line":709,"updated":"2013-11-24 07:29:30.000000000","message":"we can\u0027t just change the vm states to active based on power_state and task_state, what if the vm is in error state and the task_states.is rebooted?","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1a7c14f5ac44f910e41a6b4b72d16519aa2db14a","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                            instance\u003dinstance)"},{"line_number":707,"context_line":"                instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":708,"context_line":"                                                 task_state\u003dNone,"},{"line_number":709,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE)"},{"line_number":710,"context_line":"            else:"},{"line_number":711,"context_line":"                LOG.debug(_(\"Instance in transitional state (%(task_state)s) \""},{"line_number":712,"context_line":"                            \"at start-up and power state is (%(power_state)s)\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BHVs%3D","line":709,"in_reply_to":"AAAATn%2F%2BjKE%3D","updated":"2013-12-02 13:31:32.000000000","message":"Good catch. I forgot to add the vm_state check at the start of this block. I\u0027ll add it in the next patch.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"2c0c7ea7c9bb3e9510d2f6f864da4a91bc1d734f","unresolved":false,"context_lines":[{"line_number":708,"context_line":"                                                 task_state\u003dNone,"},{"line_number":709,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE)"},{"line_number":710,"context_line":"            else:"},{"line_number":711,"context_line":"                LOG.debug(_(\"Instance in transitional state (%(task_state)s) \""},{"line_number":712,"context_line":"                            \"at start-up and power state is (%(power_state)s)\""},{"line_number":713,"context_line":"                            \", attempting to reboot\"),"},{"line_number":714,"context_line":"                            {\u0027task_state\u0027: instance[\u0027task_state\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BjJ8%3D","line":711,"updated":"2013-11-24 07:29:30.000000000","message":"if the instance state is in error, can we continue reboot? whatever soft or hard.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1d17d3eecd05525aaa259407754632251e861b2b","unresolved":false,"context_lines":[{"line_number":708,"context_line":"                                                 task_state\u003dNone,"},{"line_number":709,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE)"},{"line_number":710,"context_line":"            else:"},{"line_number":711,"context_line":"                LOG.debug(_(\"Instance in transitional state (%(task_state)s) \""},{"line_number":712,"context_line":"                            \"at start-up and power state is (%(power_state)s)\""},{"line_number":713,"context_line":"                            \", attempting to reboot\"),"},{"line_number":714,"context_line":"                            {\u0027task_state\u0027: instance[\u0027task_state\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F97Xs%3D","line":711,"in_reply_to":"AAAATn%2F%2BHVo%3D","updated":"2013-12-04 11:28:10.000000000","message":"Apologies I hit done on this when I should have answered your question. Looking at the api code we allow hard reboots for instances in error state and in the majority of cases I believe the error state will be pre-existing and the reboot will have been requested by the user. There\u0027s a small chance I suppose that the instance went into error state during the first reboot attempt but in that case I see no risk in attempting to reboot again.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1a7c14f5ac44f910e41a6b4b72d16519aa2db14a","unresolved":false,"context_lines":[{"line_number":708,"context_line":"                                                 task_state\u003dNone,"},{"line_number":709,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE)"},{"line_number":710,"context_line":"            else:"},{"line_number":711,"context_line":"                LOG.debug(_(\"Instance in transitional state (%(task_state)s) \""},{"line_number":712,"context_line":"                            \"at start-up and power state is (%(power_state)s)\""},{"line_number":713,"context_line":"                            \", attempting to reboot\"),"},{"line_number":714,"context_line":"                            {\u0027task_state\u0027: instance[\u0027task_state\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BHVo%3D","line":711,"in_reply_to":"AAAATn%2F%2BjJ8%3D","updated":"2013-12-02 13:31:32.000000000","message":"Done","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"511af2144319fd90887060948337698fb67224a2","unresolved":false,"context_lines":[{"line_number":685,"context_line":"                        instance[\u0027task_state\u0027], instance\u003dinstance)"},{"line_number":686,"context_line":"            instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":687,"context_line":"                                   task_state\u003dNone)"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":690,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":691,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9544%3D","line":688,"updated":"2013-12-04 17:13:10.000000000","message":"What about moving all if in separate methods with \"self-explanatory\" names?\nThat makes the code more readable \u003d\u003e I had to read the debug message to understand what scenario was.\nIt makes easier to create proper unittests, just testing the logic you are going to implement here","commit_id":"f03c989ae330503520fc3b9a50d7c1f691be6e70"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"caf0542b6e27e5319aa3a101867d45fa370477e9","unresolved":false,"context_lines":[{"line_number":685,"context_line":"                        instance[\u0027task_state\u0027], instance\u003dinstance)"},{"line_number":686,"context_line":"            instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":687,"context_line":"                                   task_state\u003dNone)"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":690,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":691,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F952k%3D","line":688,"in_reply_to":"AAAATn%2F9544%3D","updated":"2013-12-04 17:15:36.000000000","message":"I had an older change that took the approach of breaking these checks (in this change and others associated with the same blueprint) into a separate method but the feedback I got seemed to indicate a preference to do the checks within _init_instance.","commit_id":"f03c989ae330503520fc3b9a50d7c1f691be6e70"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"511af2144319fd90887060948337698fb67224a2","unresolved":false,"context_lines":[{"line_number":726,"context_line":"                # Instance is not running so reboot type has to be HARD"},{"line_number":727,"context_line":"                self.compute_rpcapi.reboot_instance(context, instance,"},{"line_number":728,"context_line":"                                                block_device_info\u003dNone,"},{"line_number":729,"context_line":"                                                reboot_type\u003d\u0027HARD\u0027)"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":732,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F957M%3D","line":729,"updated":"2013-12-04 17:13:10.000000000","message":"I think we can return here, no point to go ahead.","commit_id":"f03c989ae330503520fc3b9a50d7c1f691be6e70"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"caf0542b6e27e5319aa3a101867d45fa370477e9","unresolved":false,"context_lines":[{"line_number":726,"context_line":"                # Instance is not running so reboot type has to be HARD"},{"line_number":727,"context_line":"                self.compute_rpcapi.reboot_instance(context, instance,"},{"line_number":728,"context_line":"                                                block_device_info\u003dNone,"},{"line_number":729,"context_line":"                                                reboot_type\u003d\u0027HARD\u0027)"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":732,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F953Q%3D","line":729,"in_reply_to":"AAAATn%2F957M%3D","updated":"2013-12-04 17:15:36.000000000","message":"Done","commit_id":"f03c989ae330503520fc3b9a50d7c1f691be6e70"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a8f7d41041227fe6f9685a30c8615e925fc21ce9","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                             \u0027power_state\u0027: current_power_state},"},{"line_number":725,"context_line":"                            instance\u003dinstance)"},{"line_number":726,"context_line":"                # Instance is not running so reboot type has to be HARD"},{"line_number":727,"context_line":"                self.compute_rpcapi.reboot_instance(context, instance,"},{"line_number":728,"context_line":"                                                block_device_info\u003dNone,"},{"line_number":729,"context_line":"                                                reboot_type\u003d\u0027HARD\u0027)"},{"line_number":730,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9b%2FA%3D","line":727,"updated":"2013-12-11 14:47:32.000000000","message":"This seems a bit racey. I guess the reboot may have already been triggered when the process was running before, so we might get failures during the reboot.\n\nBut I can\u0027t think of anything better, lets see how this works out.","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"140ab4d8819a4be1e34f6423ee1ecfc01f1cd898","unresolved":false,"context_lines":[{"line_number":2349,"context_line":"            instance.task_state \u003d task_states.REBOOT_PENDING"},{"line_number":2350,"context_line":"        else:"},{"line_number":2351,"context_line":"            instance.task_state \u003d task_states.REBOOT_PENDING_HARD"},{"line_number":2352,"context_line":"        instance.save()"},{"line_number":2353,"context_line":"        context \u003d context.elevated()"},{"line_number":2354,"context_line":"        LOG.audit(_(\"Rebooting instance\"), context\u003dcontext, instance\u003dinstance)"},{"line_number":2355,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9b5o%3D","line":2352,"updated":"2013-12-11 14:57:30.000000000","message":"Should we not check for the expected task state here? This should help catch any duplicate reboot requests.","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"890c954cf387483598969a638079286b1096e4fd","unresolved":false,"context_lines":[{"line_number":2349,"context_line":"            instance.task_state \u003d task_states.REBOOT_PENDING"},{"line_number":2350,"context_line":"        else:"},{"line_number":2351,"context_line":"            instance.task_state \u003d task_states.REBOOT_PENDING_HARD"},{"line_number":2352,"context_line":"        instance.save()"},{"line_number":2353,"context_line":"        context \u003d context.elevated()"},{"line_number":2354,"context_line":"        LOG.audit(_(\"Rebooting instance\"), context\u003dcontext, instance\u003dinstance)"},{"line_number":2355,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9U58%3D","line":2352,"in_reply_to":"AAAATn%2F9b5o%3D","updated":"2013-12-12 16:43:22.000000000","message":"Done","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"140ab4d8819a4be1e34f6423ee1ecfc01f1cd898","unresolved":false,"context_lines":[{"line_number":2362,"context_line":""},{"line_number":2363,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":2364,"context_line":""},{"line_number":2365,"context_line":"        instance.power_state \u003d current_power_state"},{"line_number":2366,"context_line":"        instance.save()"},{"line_number":2367,"context_line":""},{"line_number":2368,"context_line":"        if instance[\u0027power_state\u0027] !\u003d power_state.RUNNING:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9b5U%3D","line":2365,"updated":"2013-12-11 14:57:30.000000000","message":"Seems odd to save the state agin for the power state, maybe just do the one save here?\n\nAlso, seems odd not to check for the expected task_state.","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"890c954cf387483598969a638079286b1096e4fd","unresolved":false,"context_lines":[{"line_number":2362,"context_line":""},{"line_number":2363,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":2364,"context_line":""},{"line_number":2365,"context_line":"        instance.power_state \u003d current_power_state"},{"line_number":2366,"context_line":"        instance.save()"},{"line_number":2367,"context_line":""},{"line_number":2368,"context_line":"        if instance[\u0027power_state\u0027] !\u003d power_state.RUNNING:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9U6A%3D","line":2365,"in_reply_to":"AAAATn%2F9b5U%3D","updated":"2013-12-12 16:43:22.000000000","message":"Done","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"140ab4d8819a4be1e34f6423ee1ecfc01f1cd898","unresolved":false,"context_lines":[{"line_number":2388,"context_line":"                instance.task_state \u003d task_states.REBOOT_STARTED"},{"line_number":2389,"context_line":"            else:"},{"line_number":2390,"context_line":"                instance.task_state \u003d task_states.REBOOT_STARTED_HARD"},{"line_number":2391,"context_line":"            instance.save()"},{"line_number":2392,"context_line":"            self.driver.reboot(context, instance,"},{"line_number":2393,"context_line":"                               network_info,"},{"line_number":2394,"context_line":"                               reboot_type,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9b50%3D","line":2391,"updated":"2013-12-11 14:57:30.000000000","message":"I would like to see expected_task_state here.","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"890c954cf387483598969a638079286b1096e4fd","unresolved":false,"context_lines":[{"line_number":2388,"context_line":"                instance.task_state \u003d task_states.REBOOT_STARTED"},{"line_number":2389,"context_line":"            else:"},{"line_number":2390,"context_line":"                instance.task_state \u003d task_states.REBOOT_STARTED_HARD"},{"line_number":2391,"context_line":"            instance.save()"},{"line_number":2392,"context_line":"            self.driver.reboot(context, instance,"},{"line_number":2393,"context_line":"                               network_info,"},{"line_number":2394,"context_line":"                               reboot_type,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9U50%3D","line":2391,"in_reply_to":"AAAATn%2F9b50%3D","updated":"2013-12-12 16:43:22.000000000","message":"Done","commit_id":"616c6575d2db31877ea21b7df196c1313e46c187"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4200f620b697ceff4094cc420e59093210285654","unresolved":false,"context_lines":[{"line_number":2361,"context_line":"        except exception.InstanceNotFound:"},{"line_number":2362,"context_line":"            LOG.warn(_(\"Instance disappeared during reboot\"),"},{"line_number":2363,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":2364,"context_line":""},{"line_number":2365,"context_line":"        self._notify_about_instance_usage(context, instance, \"reboot.end\")"},{"line_number":2366,"context_line":""},{"line_number":2367,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FFfY%3D","side":"PARENT","line":2364,"updated":"2014-01-17 15:45:08.000000000","message":"Nit: best to remove this change.","commit_id":"3912d7aae21dfff5a42dd71bd45ef5c5f3b1a82b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"fd6490a18087606d47b2481f8df042736770424e","unresolved":false,"context_lines":[{"line_number":2361,"context_line":"        except exception.InstanceNotFound:"},{"line_number":2362,"context_line":"            LOG.warn(_(\"Instance disappeared during reboot\"),"},{"line_number":2363,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":2364,"context_line":""},{"line_number":2365,"context_line":"        self._notify_about_instance_usage(context, instance, \"reboot.end\")"},{"line_number":2366,"context_line":""},{"line_number":2367,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2B9HE%3D","side":"PARENT","line":2364,"in_reply_to":"AAAAUH%2F%2FFfY%3D","updated":"2014-01-21 14:54:16.000000000","message":"Done","commit_id":"3912d7aae21dfff5a42dd71bd45ef5c5f3b1a82b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4200f620b697ceff4094cc420e59093210285654","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                                   task_state\u003dNone)"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":682,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":683,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if ((instance.task_state \u003d\u003d task_states.REBOOT_PENDING and"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FKmE%3D","line":682,"updated":"2014-01-17 15:45:08.000000000","message":"its a nit, but I recon this line could go in nova utils (or similar) with its own unit tests.","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"fd6490a18087606d47b2481f8df042736770424e","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                                   task_state\u003dNone)"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":682,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":683,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if ((instance.task_state \u003d\u003d task_states.REBOOT_PENDING and"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2B7Y0%3D","line":682,"in_reply_to":"AAAAUH%2F%2FKmE%3D","updated":"2014-01-21 14:54:16.000000000","message":"Done","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4200f620b697ceff4094cc420e59093210285654","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":683,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if ((instance.task_state \u003d\u003d task_states.REBOOT_PENDING and"},{"line_number":686,"context_line":"             instance.vm_state in vm_states.ALLOW_SOFT_REBOOT) or"},{"line_number":687,"context_line":"            (instance.task_state \u003d\u003d task_states.REBOOT_PENDING_HARD and"},{"line_number":688,"context_line":"             instance.vm_state in vm_states.ALLOW_HARD_REBOOT)):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FKk8%3D","line":685,"updated":"2014-01-17 15:45:08.000000000","message":"Its a nit, but I would love an should_retry_reboot(task_state,vm_states) method","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"fd6490a18087606d47b2481f8df042736770424e","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":683,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        if ((instance.task_state \u003d\u003d task_states.REBOOT_PENDING and"},{"line_number":686,"context_line":"             instance.vm_state in vm_states.ALLOW_SOFT_REBOOT) or"},{"line_number":687,"context_line":"            (instance.task_state \u003d\u003d task_states.REBOOT_PENDING_HARD and"},{"line_number":688,"context_line":"             instance.vm_state in vm_states.ALLOW_HARD_REBOOT)):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2B7Ys%3D","line":685,"in_reply_to":"AAAAUH%2F%2FKk8%3D","updated":"2014-01-21 14:54:16.000000000","message":"Done","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4200f620b697ceff4094cc420e59093210285654","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                            {\u0027task_state\u0027: instance[\u0027task_state\u0027],"},{"line_number":707,"context_line":"                             \u0027power_state\u0027: current_power_state},"},{"line_number":708,"context_line":"                            instance\u003dinstance)"},{"line_number":709,"context_line":"                instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":710,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE,"},{"line_number":711,"context_line":"                                                 task_state\u003dNone)"},{"line_number":712,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FFkg%3D","line":709,"updated":"2014-01-17 15:45:08.000000000","message":"this seems OK, but I guess there is an opportunity we didn\u0027t perform the reboot.\n\nCan we change this log message to a Warning?\n\nI wondering about adding an instance fault, but thats probably overkill.","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"fd6490a18087606d47b2481f8df042736770424e","unresolved":false,"context_lines":[{"line_number":706,"context_line":"                            {\u0027task_state\u0027: instance[\u0027task_state\u0027],"},{"line_number":707,"context_line":"                             \u0027power_state\u0027: current_power_state},"},{"line_number":708,"context_line":"                            instance\u003dinstance)"},{"line_number":709,"context_line":"                instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":710,"context_line":"                                                 vm_state\u003dvm_states.ACTIVE,"},{"line_number":711,"context_line":"                                                 task_state\u003dNone)"},{"line_number":712,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2B87s%3D","line":709,"in_reply_to":"AAAAUH%2F%2FFkg%3D","updated":"2014-01-21 14:54:16.000000000","message":"Done","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4200f620b697ceff4094cc420e59093210285654","unresolved":false,"context_lines":[{"line_number":2357,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":2358,"context_line":""},{"line_number":2359,"context_line":"        instance.power_state \u003d current_power_state"},{"line_number":2360,"context_line":"        instance.save(expected_task_state\u003dexpected_states)"},{"line_number":2361,"context_line":""},{"line_number":2362,"context_line":"        if instance[\u0027power_state\u0027] !\u003d power_state.RUNNING:"},{"line_number":2363,"context_line":"            state \u003d instance[\u0027power_state\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FFfA%3D","line":2360,"updated":"2014-01-17 15:45:08.000000000","message":"Awesome, thanks.","commit_id":"3f47ffd6ee3741ba10dbfab3ff00c4dcb66dfac3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e90798bcff4645526037ee6ff93dbb4ce5dce264","unresolved":false,"context_lines":[{"line_number":694,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":695,"context_line":"            return"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        if instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":698,"context_line":"                                   task_states.REBOOT_STARTED_HARD]:"},{"line_number":699,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":700,"context_line":"                LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2BE9w%3D","line":697,"updated":"2014-01-30 12:04:15.000000000","message":"minor nit - consider:\nif (current_power_state \u003d\u003d power_state.RUNNING and\n   instance.task_state in [task_states.REBOOT_STARTED ...)\n\nIt will be a little more efficient","commit_id":"3ea0c4e06ab653a554f7c459776b1f8c5022e3b8"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"70a7c5725b6104000ca97f4a8b2da610f8111f9d","unresolved":false,"context_lines":[{"line_number":694,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":695,"context_line":"            return"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        if instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":698,"context_line":"                                   task_states.REBOOT_STARTED_HARD]:"},{"line_number":699,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":700,"context_line":"                LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F9268%3D","line":697,"in_reply_to":"AAAAUH%2F%2BE9w%3D","updated":"2014-02-03 09:11:09.000000000","message":"You\u0027re right, I should have consolidated these when I moved the rest of the code around. I\u0027ll do it now.","commit_id":"3ea0c4e06ab653a554f7c459776b1f8c5022e3b8"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"03303abeda4a75598b003e86029a32d40786e572","unresolved":false,"context_lines":[{"line_number":701,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":702,"context_line":"            return"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        if (current_power_state \u003d\u003d power_state.RUNNING and"},{"line_number":705,"context_line":"           instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":706,"context_line":"                                   task_states.REBOOT_STARTED_HARD]):"},{"line_number":707,"context_line":"            LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9okw%3D","line":704,"updated":"2014-02-05 14:06:58.000000000","message":"Feels like this would be clearer if it was an else rather than if","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1320227479c401df2b6ac417c626c6fcb978465b","unresolved":false,"context_lines":[{"line_number":701,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":702,"context_line":"            return"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        if (current_power_state \u003d\u003d power_state.RUNNING and"},{"line_number":705,"context_line":"           instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":706,"context_line":"                                   task_states.REBOOT_STARTED_HARD]):"},{"line_number":707,"context_line":"            LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9oL4%3D","line":704,"in_reply_to":"AAAAUH%2F9okw%3D","updated":"2014-02-05 15:45:08.000000000","message":"Done","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"03303abeda4a75598b003e86029a32d40786e572","unresolved":false,"context_lines":[{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        if instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":796,"context_line":"                                   task_states.REBOOT_STARTED_HARD]:"},{"line_number":797,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":798,"context_line":"                return False, None"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                return True, \u0027HARD\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9ong%3D","line":797,"updated":"2014-02-05 14:06:58.000000000","message":"Why not make this:\n\nif (instance.task_state in [task_states.REBOOT_STARTED,\n                                      task_states.REBOOT_STARTED_HARD] and\n   current_power_state !\u003d power_state.RUNNING):\n       return True, reboot_type\nelse:\n       return False, None","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1320227479c401df2b6ac417c626c6fcb978465b","unresolved":false,"context_lines":[{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        if instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":796,"context_line":"                                   task_states.REBOOT_STARTED_HARD]:"},{"line_number":797,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":798,"context_line":"                return False, None"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                return True, \u0027HARD\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9oB8%3D","line":797,"in_reply_to":"AAAAUH%2F9ong%3D","updated":"2014-02-05 15:45:08.000000000","message":"Done","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"03303abeda4a75598b003e86029a32d40786e572","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":798,"context_line":"                return False, None"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                return True, \u0027HARD\u0027"},{"line_number":801,"context_line":"        return False, None"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    def handle_lifecycle_event(self, event):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9olQ%3D","line":800,"updated":"2014-02-05 14:06:58.000000000","message":"Moot point if you accept the change above - but I think this should be return True, reboot_type","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1320227479c401df2b6ac417c626c6fcb978465b","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            if current_power_state \u003d\u003d power_state.RUNNING:"},{"line_number":798,"context_line":"                return False, None"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                return True, \u0027HARD\u0027"},{"line_number":801,"context_line":"        return False, None"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    def handle_lifecycle_event(self, event):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9oB4%3D","line":800,"in_reply_to":"AAAAUH%2F9olQ%3D","updated":"2014-02-05 15:45:08.000000000","message":"Done","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"738c459121382d781c8d64615d4424e8d9837199","unresolved":false,"context_lines":[{"line_number":701,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":702,"context_line":"            return"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        if (current_power_state \u003d\u003d power_state.RUNNING and"},{"line_number":705,"context_line":"           instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":706,"context_line":"                                   task_states.REBOOT_STARTED_HARD]):"},{"line_number":707,"context_line":"            LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9hVk%3D","line":704,"updated":"2014-02-06 10:40:17.000000000","message":"still think this should be \"elif\" as logically this is part of the same processing as the pervious \"if\" block","commit_id":"5fc186dc110d67d8a9791ccc6bcf5cd0248d31b6"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"c34e4bd77daed0727acca1a22336e86070447528","unresolved":false,"context_lines":[{"line_number":701,"context_line":"                                                reboot_type\u003dreboot_type)"},{"line_number":702,"context_line":"            return"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        if (current_power_state \u003d\u003d power_state.RUNNING and"},{"line_number":705,"context_line":"           instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":706,"context_line":"                                   task_states.REBOOT_STARTED_HARD]):"},{"line_number":707,"context_line":"            LOG.warning(_(\"Instance in transitional state \""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9hM4%3D","line":704,"in_reply_to":"AAAAUH%2F9hVk%3D","updated":"2014-02-06 10:59:39.000000000","message":"Apologies I had intended to make that change in the last patch set. I\u0027ll do it now.","commit_id":"5fc186dc110d67d8a9791ccc6bcf5cd0248d31b6"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"384d4611a5bea96ed465fb26f054bbe02ed12239","unresolved":false,"context_lines":[{"line_number":796,"context_line":"                                   task_states.REBOOT_STARTED_HARD] and"},{"line_number":797,"context_line":"            current_power_state !\u003d power_state.RUNNING):"},{"line_number":798,"context_line":"            # Instance is not running so use a HARD reboot"},{"line_number":799,"context_line":"            return True, \u0027HARD\u0027"},{"line_number":800,"context_line":"        else:"},{"line_number":801,"context_line":"            return False, None"},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F9gA8%3D","line":799,"updated":"2014-02-06 14:09:44.000000000","message":"That\u0027s confusing me: task_states.REBOOT_STARTED is one of the task state used in get_reboot_type to get back a soft reboot, but in this case you pass back a \"HARD\" reboot, probably because the power_state is not RUNNING, so why not include all the logic for HARD/SOFT reboot in the get_reboot_type?","commit_id":"cc50f426269fa5db73a02ee58655c404f8a26323"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d13dc5a6189f01b60520a3c39c38ad6f1692257e","unresolved":false,"context_lines":[{"line_number":796,"context_line":"                                   task_states.REBOOT_STARTED_HARD] and"},{"line_number":797,"context_line":"            current_power_state !\u003d power_state.RUNNING):"},{"line_number":798,"context_line":"            # Instance is not running so use a HARD reboot"},{"line_number":799,"context_line":"            return True, \u0027HARD\u0027"},{"line_number":800,"context_line":"        else:"},{"line_number":801,"context_line":"            return False, None"},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F9ZJY%3D","line":799,"in_reply_to":"AAAAUH%2F9gA8%3D","updated":"2014-02-07 08:19:22.000000000","message":"Done","commit_id":"cc50f426269fa5db73a02ee58655c404f8a26323"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":720,"context_line":"        elif (current_power_state \u003d\u003d power_state.RUNNING and"},{"line_number":721,"context_line":"           instance.task_state in [task_states.REBOOT_STARTED,"},{"line_number":722,"context_line":"                                   task_states.REBOOT_STARTED_HARD]):"},{"line_number":723,"context_line":"            LOG.warning(_(\"Instance in transitional state \""},{"line_number":724,"context_line":"                          \"(%(task_state)s) at start-up and power state \""},{"line_number":725,"context_line":"                          \"is (%(power_state)s), clearing task state\"),"},{"line_number":726,"context_line":"                        {\u0027task_state\u0027: instance[\u0027task_state\u0027],"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FfdM%3D","line":723,"updated":"2014-02-26 10:30:49.000000000","message":"Thanks, this is useful.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":810,"context_line":"             instance.vm_state in vm_states.ALLOW_HARD_REBOOT) or"},{"line_number":811,"context_line":"            (current_task_state in [task_states.REBOOT_STARTED,"},{"line_number":812,"context_line":"                                    task_states.REBOOT_STARTED_HARD] and"},{"line_number":813,"context_line":"             current_power_state !\u003d power_state.RUNNING)):"},{"line_number":814,"context_line":"            return True, reboot_type"},{"line_number":815,"context_line":"        else:"},{"line_number":816,"context_line":"            return False, None"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FfeE%3D","line":813,"updated":"2014-02-26 10:30:49.000000000","message":"nit, this is still hard to read.\n\nwe could do something like:\npending_soft\u003d, pending_hard\u003d, started_and_running\u003d,","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"a517a362a3e3bafea266dfed2a46c1e3d20066eb","unresolved":false,"context_lines":[{"line_number":810,"context_line":"             instance.vm_state in vm_states.ALLOW_HARD_REBOOT) or"},{"line_number":811,"context_line":"            (current_task_state in [task_states.REBOOT_STARTED,"},{"line_number":812,"context_line":"                                    task_states.REBOOT_STARTED_HARD] and"},{"line_number":813,"context_line":"             current_power_state !\u003d power_state.RUNNING)):"},{"line_number":814,"context_line":"            return True, reboot_type"},{"line_number":815,"context_line":"        else:"},{"line_number":816,"context_line":"            return False, None"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2Fc%2Bk%3D","line":813,"in_reply_to":"AAAAU3%2F%2FfeE%3D","updated":"2014-02-26 15:09:27.000000000","message":"I\u0027m not sure I understand what you\u0027re suggesting here.\n\nDo you mean \npending_soft\u003d(current_task_state \u003d\u003d task_states.REBOOT_PENDING and  instance.vm_state in vm_states.ALLOW_SOFT_REBOOT)\n\nand then\nif pending_soft: do stuff\n?","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":813,"context_line":"             current_power_state !\u003d power_state.RUNNING)):"},{"line_number":814,"context_line":"            return True, reboot_type"},{"line_number":815,"context_line":"        else:"},{"line_number":816,"context_line":"            return False, None"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def handle_lifecycle_event(self, event):"},{"line_number":819,"context_line":"        LOG.info(_(\"Lifecycle event %(state)d on VM %(uuid)s\") %"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FfdY%3D","line":816,"updated":"2014-02-26 10:30:49.000000000","message":"nit, having this at the end, would make it much easier to read:\nreturn try_reboot, reboot_type\n\nYou may as well always return the reboot type right? Makes it easier to read.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"a517a362a3e3bafea266dfed2a46c1e3d20066eb","unresolved":false,"context_lines":[{"line_number":813,"context_line":"             current_power_state !\u003d power_state.RUNNING)):"},{"line_number":814,"context_line":"            return True, reboot_type"},{"line_number":815,"context_line":"        else:"},{"line_number":816,"context_line":"            return False, None"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def handle_lifecycle_event(self, event):"},{"line_number":819,"context_line":"        LOG.info(_(\"Lifecycle event %(state)d on VM %(uuid)s\") %"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2Fd8c%3D","line":816,"in_reply_to":"AAAAU3%2F%2FfdY%3D","updated":"2014-02-26 15:09:27.000000000","message":"Done","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":2452,"context_line":"            else:"},{"line_number":2453,"context_line":"                new_vm_state \u003d vm_states.ACTIVE"},{"line_number":2454,"context_line":"            new_power_state \u003d None"},{"line_number":2455,"context_line":"            if reboot_type \u003d\u003d \"SOFT\":"},{"line_number":2456,"context_line":"                instance.task_state \u003d task_states.REBOOT_STARTED"},{"line_number":2457,"context_line":"                expected_state \u003d task_states.REBOOT_PENDING"},{"line_number":2458,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2FfcY%3D","line":2455,"updated":"2014-02-26 10:30:49.000000000","message":"I keep thinking about an enum object for reboot_type that gives you all these specific states, rather than having lots of if statements.\n\nBut its probably overkill.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":729,"context_line":"            instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":730,"context_line":"                                             vm_state\u003dvm_states.ACTIVE,"},{"line_number":731,"context_line":"                                             task_state\u003dNone)"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":734,"context_line":"        try:"},{"line_number":735,"context_line":"            self.driver.plug_vifs(instance, net_info)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa68%3D","line":732,"updated":"2014-02-26 18:50:01.000000000","message":"Not necessarily a problem introduced by this patch, but this method is getting too long, IMHO. Would be nice to have more of this:\n\n  if state \u003d\u003d foo:\n    self._init_instance_in_foo()\n  elif state \u003d\u003d bar:\n    self._init_instance_in_bar()","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":729,"context_line":"            instance \u003d self._instance_update(context, instance.uuid,"},{"line_number":730,"context_line":"                                             vm_state\u003dvm_states.ACTIVE,"},{"line_number":731,"context_line":"                                             task_state\u003dNone)"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":734,"context_line":"        try:"},{"line_number":735,"context_line":"            self.driver.plug_vifs(instance, net_info)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F7is%3D","line":732,"in_reply_to":"AAAAU3%2F%2Fa68%3D","updated":"2014-02-27 09:48:49.000000000","message":"I would tend to agree but I\u0027d rather not hold up getting this functionality in at the moment.\nI\u0027d be happy to have a go at refactoring this method as part of a separate change that could pull out a lot of the different state checking stuff into individual parts.","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"4e7e83ab4ec8db0048c175f1eff645f4d2d0983f","unresolved":false,"context_lines":[{"line_number":799,"context_line":"                LOG.warning(_(\u0027Hypervisor driver does not support \u0027"},{"line_number":800,"context_line":"                              \u0027firewall rules\u0027), instance\u003dinstance)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"    def _retry_reboot(self, context, instance):"},{"line_number":803,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":804,"context_line":"        current_task_state \u003d instance.task_state"},{"line_number":805,"context_line":"        retry_reboot \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVn%2F%2F2%2Bo%3D","line":802,"updated":"2014-03-03 19:28:47.000000000","message":"Method name is a tad bit confusing.  I would expect it to execute a reboot command.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"957a22cb885fb585ce326f89a0fbac1e074c98d8","unresolved":false,"context_lines":[{"line_number":799,"context_line":"                LOG.warning(_(\u0027Hypervisor driver does not support \u0027"},{"line_number":800,"context_line":"                              \u0027firewall rules\u0027), instance\u003dinstance)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"    def _retry_reboot(self, context, instance):"},{"line_number":803,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":804,"context_line":"        current_task_state \u003d instance.task_state"},{"line_number":805,"context_line":"        retry_reboot \u003d False"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVn%2F%2Fh48%3D","line":802,"in_reply_to":"AAAAVn%2F%2F2%2Bo%3D","updated":"2014-03-05 15:49:31.000000000","message":"Noted, I\u0027ve changed it slightly to reflect it\u0027s a check and not an action.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"4e7e83ab4ec8db0048c175f1eff645f4d2d0983f","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":804,"context_line":"        current_task_state \u003d instance.task_state"},{"line_number":805,"context_line":"        retry_reboot \u003d False"},{"line_number":806,"context_line":"        reboot_type \u003d compute_utils.get_reboot_type(current_task_state,"},{"line_number":807,"context_line":"                                                    current_power_state)"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"        pending_soft \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING and"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVn%2F%2F2%2BY%3D","line":806,"updated":"2014-03-03 19:28:47.000000000","message":"Seems like reboot_type should be None if there is no reboot pending.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"957a22cb885fb585ce326f89a0fbac1e074c98d8","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":804,"context_line":"        current_task_state \u003d instance.task_state"},{"line_number":805,"context_line":"        retry_reboot \u003d False"},{"line_number":806,"context_line":"        reboot_type \u003d compute_utils.get_reboot_type(current_task_state,"},{"line_number":807,"context_line":"                                                    current_power_state)"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"        pending_soft \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING and"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVn%2F%2Fivk%3D","line":806,"in_reply_to":"AAAAVn%2F%2F2%2BY%3D","updated":"2014-03-05 15:49:31.000000000","message":"reboot_type just checks if a hard or soft reboot is required based on power state and, to a certain extent, task state. It doesn\u0027t make any decision about whether the instance should be rebooted.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"18573adc4ac32aa21f7c51c86e1940c55757bcae","unresolved":false,"context_lines":[{"line_number":806,"context_line":"        reboot_type \u003d compute_utils.get_reboot_type(current_task_state,"},{"line_number":807,"context_line":"                                                    current_power_state)"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"        pending_soft \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING and"},{"line_number":810,"context_line":"                        instance.vm_state in vm_states.ALLOW_SOFT_REBOOT)"},{"line_number":811,"context_line":"        pending_hard \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING_HARD"},{"line_number":812,"context_line":"                        and instance.vm_state in vm_states.ALLOW_HARD_REBOOT)"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVX%2F%2Fubg%3D","line":809,"updated":"2014-02-28 18:50:12.000000000","message":"micro nit: not sure the brackets are adding anything here","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"957a22cb885fb585ce326f89a0fbac1e074c98d8","unresolved":false,"context_lines":[{"line_number":806,"context_line":"        reboot_type \u003d compute_utils.get_reboot_type(current_task_state,"},{"line_number":807,"context_line":"                                                    current_power_state)"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"        pending_soft \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING and"},{"line_number":810,"context_line":"                        instance.vm_state in vm_states.ALLOW_SOFT_REBOOT)"},{"line_number":811,"context_line":"        pending_hard \u003d (current_task_state \u003d\u003d task_states.REBOOT_PENDING_HARD"},{"line_number":812,"context_line":"                        and instance.vm_state in vm_states.ALLOW_HARD_REBOOT)"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVn%2F%2FiVg%3D","line":809,"in_reply_to":"AAAAVX%2F%2Fubg%3D","updated":"2014-03-05 15:49:31.000000000","message":"They\u0027re required for the line wrap to work.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"18573adc4ac32aa21f7c51c86e1940c55757bcae","unresolved":false,"context_lines":[{"line_number":815,"context_line":"                                task_states.REBOOT_STARTED_HARD] and"},{"line_number":816,"context_line":"                               current_power_state !\u003d power_state.RUNNING)"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"        if pending_soft or pending_hard or started_not_running:"},{"line_number":819,"context_line":"            retry_reboot \u003d True"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"        return retry_reboot, reboot_type"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVX%2F%2Fub8%3D","line":818,"updated":"2014-02-28 18:50:12.000000000","message":"nice, this is easier to understand, thanks.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"}],"nova/compute/task_states.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"925b69a99586cf6578841108433fa4fc2bdb9213","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# possible task states during reboot()"},{"line_number":57,"context_line":"REBOOTING \u003d \u0027rebooting\u0027"},{"line_number":58,"context_line":"REBOOT_PENDING \u003d \u0027reboot_pending\u0027"},{"line_number":59,"context_line":"REBOOT_STARTED \u003d \u0027reboot_started\u0027"},{"line_number":60,"context_line":"REBOOTING_HARD \u003d \u0027rebooting_hard\u0027"},{"line_number":61,"context_line":"REBOOT_PENDING_HARD \u003d \u0027reboot_pending_hard\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2Ffb4%3D","line":58,"updated":"2014-02-26 10:30:49.000000000","message":"I still worry that this changes the API, but I can\u0027t see a sensible way around it. And we have broken this kind of thing before. I will see what others think about this one. We could make the API layer map reboot_pending, etc to rebooting.\n\nI do wonder if this should be:\nREBOOT_PENDING_SOFT\nBut this is consistent with REBOOTING, so I am cool with it.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"a517a362a3e3bafea266dfed2a46c1e3d20066eb","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# possible task states during reboot()"},{"line_number":57,"context_line":"REBOOTING \u003d \u0027rebooting\u0027"},{"line_number":58,"context_line":"REBOOT_PENDING \u003d \u0027reboot_pending\u0027"},{"line_number":59,"context_line":"REBOOT_STARTED \u003d \u0027reboot_started\u0027"},{"line_number":60,"context_line":"REBOOTING_HARD \u003d \u0027rebooting_hard\u0027"},{"line_number":61,"context_line":"REBOOT_PENDING_HARD \u003d \u0027reboot_pending_hard\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAU3%2F%2Fc6g%3D","line":58,"in_reply_to":"AAAAU3%2F%2Ffb4%3D","updated":"2014-02-26 15:09:27.000000000","message":"We could start mapping the various task_states but from a (very) brief look it seems that currently there are mappings for vm_states but not task_states  so possibly if this was a new feature it should be done as part of a separate change.","commit_id":"4fb6232857295a96ed9ce7bdac030d1376038688"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"18573adc4ac32aa21f7c51c86e1940c55757bcae","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# possible task states during reboot()"},{"line_number":57,"context_line":"REBOOTING \u003d \u0027rebooting\u0027"},{"line_number":58,"context_line":"REBOOT_PENDING \u003d \u0027reboot_pending\u0027"},{"line_number":59,"context_line":"REBOOT_STARTED \u003d \u0027reboot_started\u0027"},{"line_number":60,"context_line":"REBOOTING_HARD \u003d \u0027rebooting_hard\u0027"},{"line_number":61,"context_line":"REBOOT_PENDING_HARD \u003d \u0027reboot_pending_hard\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVX%2F%2FuZY%3D","line":58,"updated":"2014-02-28 18:50:12.000000000","message":"so, I still this we need to hide these from the API somehow.\n\ntask_state_alias, or something like that, a dict that says if a particular state should be presented to the user as something else.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"}],"nova/compute/utils.py":[{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"03303abeda4a75598b003e86029a32d40786e572","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def get_reboot_type(instance):"},{"line_number":433,"context_line":"    \"\"\"Checks if the current instance state requires a HARD reboot.\"\"\""},{"line_number":434,"context_line":"    soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":435,"context_line":"    reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":436,"context_line":"    return reboot_type"},{"line_number":437,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9opY%3D","line":434,"updated":"2014-02-05 14:06:58.000000000","message":"Shouldn\u0027t task_states.REBOOTING also be in this list ?  It looks otherwise that there is a risk of turning a soft reboot into a hard one","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1320227479c401df2b6ac417c626c6fcb978465b","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def get_reboot_type(instance):"},{"line_number":433,"context_line":"    \"\"\"Checks if the current instance state requires a HARD reboot.\"\"\""},{"line_number":434,"context_line":"    soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING]"},{"line_number":435,"context_line":"    reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"},{"line_number":436,"context_line":"    return reboot_type"},{"line_number":437,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9n6w%3D","line":434,"in_reply_to":"AAAAUH%2F9opY%3D","updated":"2014-02-05 15:45:08.000000000","message":"Done","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"384d4611a5bea96ed465fb26f054bbe02ed12239","unresolved":false,"context_lines":[{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def get_reboot_type(instance):"},{"line_number":433,"context_line":"    \"\"\"Checks if the current instance state requires a HARD reboot.\"\"\""},{"line_number":434,"context_line":"    soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING,"},{"line_number":435,"context_line":"                  task_states.REBOOTING]"},{"line_number":436,"context_line":"    reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F9gAo%3D","line":433,"updated":"2014-02-06 14:09:44.000000000","message":"The doc string is not really accurate, please can you change it in order to reflect the real purpose of the method?","commit_id":"cc50f426269fa5db73a02ee58655c404f8a26323"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d13dc5a6189f01b60520a3c39c38ad6f1692257e","unresolved":false,"context_lines":[{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def get_reboot_type(instance):"},{"line_number":433,"context_line":"    \"\"\"Checks if the current instance state requires a HARD reboot.\"\"\""},{"line_number":434,"context_line":"    soft_types \u003d [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING,"},{"line_number":435,"context_line":"                  task_states.REBOOTING]"},{"line_number":436,"context_line":"    reboot_type \u003d \u0027SOFT\u0027 if instance.task_state in soft_types else \u0027HARD\u0027"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F9ZJI%3D","line":433,"in_reply_to":"AAAAUH%2F9gAo%3D","updated":"2014-02-07 08:19:22.000000000","message":"Left docstring unchanged, I did alter the function though.","commit_id":"cc50f426269fa5db73a02ee58655c404f8a26323"}],"nova/compute/vm_states.py":[{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"03303abeda4a75598b003e86029a32d40786e572","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"ALLOW_SOFT_REBOOT \u003d [ACTIVE]  # states we can soft reboot from"},{"line_number":51,"context_line":"ALLOW_HARD_REBOOT \u003d ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]"},{"line_number":52,"context_line":"# states we allow hard reboot from"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9ojA%3D","line":52,"updated":"2014-02-05 14:06:58.000000000","message":"To keep consistent the API code here should also be changed to used these new values:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L2056-L2058\n\nThat check doesn\u0027t distinguish between soft and hard reboot, so its not clear why you need two different sets ?","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1320227479c401df2b6ac417c626c6fcb978465b","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"ALLOW_SOFT_REBOOT \u003d [ACTIVE]  # states we can soft reboot from"},{"line_number":51,"context_line":"ALLOW_HARD_REBOOT \u003d ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]"},{"line_number":52,"context_line":"# states we allow hard reboot from"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F9oCQ%3D","line":52,"in_reply_to":"AAAAUH%2F9ojA%3D","updated":"2014-02-05 15:45:08.000000000","message":"I can change the API for consistency. You\u0027re correct that the decorator check doesn\u0027t distinguish but there is logic in the function itself to filter which states allow soft/hard reboots. And I use this during the reboot retry to identify which type of reboot can or should be used.","commit_id":"5324009539e7df7491dbc22e6885c9259fa94a52"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"ALLOW_SOFT_REBOOT \u003d [ACTIVE]  # states we can soft reboot from"},{"line_number":51,"context_line":"ALLOW_HARD_REBOOT \u003d ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]"},{"line_number":52,"context_line":"# states we allow hard reboot from"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa3w%3D","line":52,"updated":"2014-02-26 18:50:01.000000000","message":"Comment below the referenced line? confusing :)","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"ALLOW_SOFT_REBOOT \u003d [ACTIVE]  # states we can soft reboot from"},{"line_number":51,"context_line":"ALLOW_HARD_REBOOT \u003d ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]"},{"line_number":52,"context_line":"# states we allow hard reboot from"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F8Qo%3D","line":52,"in_reply_to":"AAAAU3%2F%2Fa3w%3D","updated":"2014-02-27 09:48:49.000000000","message":"I can put it above but I was following the pattern used throughout the file where the comments are following/wrapping under the line so putting it above may also cause confusion :)","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"}],"nova/tests/api/openstack/compute/plugins/v3/test_servers.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":958,"context_line":"            self.assertEqual(search_opts[\u0027task_state\u0027],"},{"line_number":959,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":960,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":961,"context_line":"                              task_states.REBOOTING])"},{"line_number":962,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":963,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":964,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa3o%3D","line":961,"updated":"2014-02-26 18:50:01.000000000","message":"This is backwards (the old code was too, but please fix it). It should be:\n\n  self.assertEqual(expected, actual)","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":958,"context_line":"            self.assertEqual(search_opts[\u0027task_state\u0027],"},{"line_number":959,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":960,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":961,"context_line":"                              task_states.REBOOTING])"},{"line_number":962,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":963,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":964,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F8JE%3D","line":961,"in_reply_to":"AAAAU3%2F%2Fa3o%3D","updated":"2014-02-27 09:48:49.000000000","message":"Done","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"18573adc4ac32aa21f7c51c86e1940c55757bcae","unresolved":false,"context_lines":[{"line_number":955,"context_line":"                         expected_attrs\u003d[]):"},{"line_number":956,"context_line":"            self.assertIsNotNone(search_opts)"},{"line_number":957,"context_line":"            self.assertIn(\u0027task_state\u0027, search_opts)"},{"line_number":958,"context_line":"            self.assertEqual([task_states.REBOOT_PENDING,"},{"line_number":959,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":960,"context_line":"                              task_states.REBOOTING],"},{"line_number":961,"context_line":"                             search_opts[\u0027task_state\u0027])"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAVX%2F%2FuaE%3D","line":958,"updated":"2014-02-28 18:50:12.000000000","message":"Yeah this stuff scares me... is this breaking the API contract... probably.","commit_id":"8b2eece75a4195ab90a7cab5c947621fae26213d"}],"nova/tests/api/openstack/compute/test_servers.py":[{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"7bdcc207de8cfe250af1169aadca4401265adcb7","unresolved":false,"context_lines":[{"line_number":881,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":882,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":883,"context_line":"                              task_states.REBOOTING])"},{"line_number":884,"context_line":"            #self.assertEqual(search_opts[\u0027task_state\u0027], [task_state])"},{"line_number":885,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":886,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":887,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2B1NQ%3D","line":884,"updated":"2014-01-21 16:51:18.000000000","message":"I think this comment could be deleted.","commit_id":"29b866a875169243716ad91c0cb00fd83a90a3d4"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"0e1e4a56d760d28b6da5ab957125f6c3270e8bba","unresolved":false,"context_lines":[{"line_number":881,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":882,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":883,"context_line":"                              task_states.REBOOTING])"},{"line_number":884,"context_line":"            #self.assertEqual(search_opts[\u0027task_state\u0027], [task_state])"},{"line_number":885,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":886,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":887,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2B1Cg%3D","line":884,"in_reply_to":"AAAAUH%2F%2B1NQ%3D","updated":"2014-01-21 16:55:36.000000000","message":"Done","commit_id":"29b866a875169243716ad91c0cb00fd83a90a3d4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":879,"context_line":"            self.assertEqual(search_opts[\u0027task_state\u0027],"},{"line_number":880,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":881,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":882,"context_line":"                              task_states.REBOOTING])"},{"line_number":883,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":884,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":885,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa3c%3D","line":882,"updated":"2014-02-26 18:50:01.000000000","message":"same.","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":879,"context_line":"            self.assertEqual(search_opts[\u0027task_state\u0027],"},{"line_number":880,"context_line":"                             [task_states.REBOOT_PENDING,"},{"line_number":881,"context_line":"                              task_states.REBOOT_STARTED,"},{"line_number":882,"context_line":"                              task_states.REBOOTING])"},{"line_number":883,"context_line":"            db_list \u003d [fakes.stub_instance(100, uuid\u003dserver_uuid,"},{"line_number":884,"context_line":"                                                task_state\u003dtask_state)]"},{"line_number":885,"context_line":"            return instance_obj._make_instance_list("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F8Is%3D","line":882,"in_reply_to":"AAAAU3%2F%2Fa3c%3D","updated":"2014-02-27 09:48:49.000000000","message":"Done","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"}],"nova/tests/compute/test_compute.py":[{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"2c0c7ea7c9bb3e9510d2f6f864da4a91bc1d734f","unresolved":false,"context_lines":[{"line_number":2141,"context_line":"                columns_to_join\u003d[\u0027system_metadata\u0027],"},{"line_number":2142,"context_line":"                ).AndRaise(exception.InstanceNotFound("},{"line_number":2143,"context_line":"                    instance_id\u003dinstance[\u0027uuid\u0027]))"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"            self.compute._notify_about_instance_usage("},{"line_number":2146,"context_line":"                econtext,"},{"line_number":2147,"context_line":"                instance,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BjKk%3D","line":2144,"updated":"2013-11-24 07:29:30.000000000","message":"This change should not be made.","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"1a7c14f5ac44f910e41a6b4b72d16519aa2db14a","unresolved":false,"context_lines":[{"line_number":2141,"context_line":"                columns_to_join\u003d[\u0027system_metadata\u0027],"},{"line_number":2142,"context_line":"                ).AndRaise(exception.InstanceNotFound("},{"line_number":2143,"context_line":"                    instance_id\u003dinstance[\u0027uuid\u0027]))"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"            self.compute._notify_about_instance_usage("},{"line_number":2146,"context_line":"                econtext,"},{"line_number":2147,"context_line":"                instance,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BHVk%3D","line":2144,"in_reply_to":"AAAATn%2F%2BjKk%3D","updated":"2013-12-02 13:31:32.000000000","message":"Done","commit_id":"352b9c381e98c19b4a884fd4156564837c18d81b"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"d2145ea60fe80b3bdc6d15ad0a4497befb52c595","unresolved":false,"context_lines":[{"line_number":2209,"context_line":"                   launched_at\u003dtimeutils.utcnow()))"},{"line_number":2210,"context_line":""},{"line_number":2211,"context_line":"        updated_dbinstance3 \u003d fake_instance.fake_db_instance("},{"line_number":2212,"context_line":"            **dict(uuid\u003d\u0027updated-instance2\u0027,"},{"line_number":2213,"context_line":"                   power_state\u003d10003,"},{"line_number":2214,"context_line":"                   vm_state\u003dvm_states.ACTIVE,"},{"line_number":2215,"context_line":"                   task_state\u003dexpected_task,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAUX%2F%2F2z0%3D","line":2212,"updated":"2014-02-10 11:49:08.000000000","message":"I think that is wrong: you get again the same instance you got from the previous bit of code: uuid\u003d\u0027updated-instance2\u0027\n\nshouldn\u0027t fail this test for this error? If not probably this scenario is not required or not well tested?","commit_id":"ec1d39e40c1b7f058cf68b1f1bc2f93276f1c00d"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"f135e25fa60e7632d8fe408feabcd1bd1bdc2f8a","unresolved":false,"context_lines":[{"line_number":2209,"context_line":"                   launched_at\u003dtimeutils.utcnow()))"},{"line_number":2210,"context_line":""},{"line_number":2211,"context_line":"        updated_dbinstance3 \u003d fake_instance.fake_db_instance("},{"line_number":2212,"context_line":"            **dict(uuid\u003d\u0027updated-instance2\u0027,"},{"line_number":2213,"context_line":"                   power_state\u003d10003,"},{"line_number":2214,"context_line":"                   vm_state\u003dvm_states.ACTIVE,"},{"line_number":2215,"context_line":"                   task_state\u003dexpected_task,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAUX%2F%2Fi8g%3D","line":2212,"in_reply_to":"AAAAUX%2F%2F2z0%3D","updated":"2014-02-12 13:15:16.000000000","message":"You\u0027re correct this is unused, it was part of an abandoned change that I left in by accident.","commit_id":"ec1d39e40c1b7f058cf68b1f1bc2f93276f1c00d"}],"nova/tests/compute/test_compute_mgr.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            mock.patch.object(self.compute, \u0027_get_power_state\u0027,"},{"line_number":463,"context_line":"                               return_value\u003dreturn_power_state),"},{"line_number":464,"context_line":"            mock.patch.object(self.compute.compute_rpcapi, \u0027reboot_instance\u0027),"},{"line_number":465,"context_line":"            mock.patch.object(compute_utils, \u0027get_nw_info_for_instance\u0027)"},{"line_number":466,"context_line":"          ) as ("},{"line_number":467,"context_line":"            _get_power_state,"},{"line_number":468,"context_line":"            reboot_instance,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa28%3D","line":465,"updated":"2014-02-26 18:50:01.000000000","message":"it\u0027s much nicer to use the decorator form of this instead of stacking the context managers, IMHO.","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            mock.patch.object(self.compute, \u0027_get_power_state\u0027,"},{"line_number":463,"context_line":"                               return_value\u003dreturn_power_state),"},{"line_number":464,"context_line":"            mock.patch.object(self.compute.compute_rpcapi, \u0027reboot_instance\u0027),"},{"line_number":465,"context_line":"            mock.patch.object(compute_utils, \u0027get_nw_info_for_instance\u0027)"},{"line_number":466,"context_line":"          ) as ("},{"line_number":467,"context_line":"            _get_power_state,"},{"line_number":468,"context_line":"            reboot_instance,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F70c%3D","line":465,"in_reply_to":"AAAAU3%2F%2Fa28%3D","updated":"2014-02-27 09:48:49.000000000","message":"Since I\u0027m patching self.compute here I don\u0027t think it\u0027s possible to do that using a decorator as self wouldn\u0027t be in the scope of the decorator. If I\u0027m wrong can you give me an example of how to do that?","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7fad76e254e2784ebc9da286ec5ebeae8cf7a5d5","unresolved":false,"context_lines":[{"line_number":974,"context_line":"        with contextlib.nested("},{"line_number":975,"context_line":"            mock.patch.object(self.compute, \u0027_get_power_state\u0027,"},{"line_number":976,"context_line":"                              return_value\u003dpower_state.RUNNING),"},{"line_number":977,"context_line":"        ) as ("},{"line_number":978,"context_line":"            _get_power_state,"},{"line_number":979,"context_line":"        ):"},{"line_number":980,"context_line":"            allow_reboot, reboot_type \u003d self.compute._retry_reboot("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAU3%2F%2Fa2o%3D","line":977,"updated":"2014-02-26 18:50:01.000000000","message":"If it\u0027s just one, please don\u0027t use nested","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"},{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"d1bb77eb238726a037cbbfccefc98e33d6200351","unresolved":false,"context_lines":[{"line_number":974,"context_line":"        with contextlib.nested("},{"line_number":975,"context_line":"            mock.patch.object(self.compute, \u0027_get_power_state\u0027,"},{"line_number":976,"context_line":"                              return_value\u003dpower_state.RUNNING),"},{"line_number":977,"context_line":"        ) as ("},{"line_number":978,"context_line":"            _get_power_state,"},{"line_number":979,"context_line":"        ):"},{"line_number":980,"context_line":"            allow_reboot, reboot_type \u003d self.compute._retry_reboot("}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVX%2F%2F7qQ%3D","line":977,"in_reply_to":"AAAAU3%2F%2Fa2o%3D","updated":"2014-02-27 09:48:49.000000000","message":"Done","commit_id":"1217afb85e5fd601e9d1216ba1602cc3979c9970"}]}
