)]}'
{"watcher/decision_engine/strategy/strategies/saving_energy.py":[{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"2bddc22ce710b0fb4191e8fc7c1bbe18f0fbe839","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @classmethod"},{"line_number":58,"context_line":"    def get_schema(cls):"},{"line_number":59,"context_line":"        # Mandatory default setting for each element"},{"line_number":60,"context_line":"        return {"},{"line_number":61,"context_line":"            \"properties\": {"},{"line_number":62,"context_line":"                \"free_used_percent\": {"},{"line_number":63,"context_line":"                    \"description\": \"workload threshold for balance\","},{"line_number":64,"context_line":"                    \"type\": \"number\","},{"line_number":65,"context_line":"                    \"default\": 10.0"},{"line_number":66,"context_line":"                },"},{"line_number":67,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":68,"context_line":"                    \"description\": \"Number of free hosts\","},{"line_number":69,"context_line":"                    \"type\": \"number\","},{"line_number":70,"context_line":"                    \"default\": 1"},{"line_number":71,"context_line":"                },"},{"line_number":72,"context_line":"            },"},{"line_number":73,"context_line":"        }"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def add_action_poweronoff_node(self, node_uuid, state):"},{"line_number":76,"context_line":"        \"\"\"Add an action for node disability into the solution."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_f5f9f4c7","line":73,"range":{"start_line":59,"start_character":0,"end_line":73,"end_character":9},"updated":"2017-06-23 07:52:32.000000000","message":"What does \u0027free_used_percent\u0027 means?\nNeed more description for these parameters.","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"9a03484576a32fa6197f5e95585fa8ea38de1978","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @classmethod"},{"line_number":58,"context_line":"    def get_schema(cls):"},{"line_number":59,"context_line":"        # Mandatory default setting for each element"},{"line_number":60,"context_line":"        return {"},{"line_number":61,"context_line":"            \"properties\": {"},{"line_number":62,"context_line":"                \"free_used_percent\": {"},{"line_number":63,"context_line":"                    \"description\": \"workload threshold for balance\","},{"line_number":64,"context_line":"                    \"type\": \"number\","},{"line_number":65,"context_line":"                    \"default\": 10.0"},{"line_number":66,"context_line":"                },"},{"line_number":67,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":68,"context_line":"                    \"description\": \"Number of free hosts\","},{"line_number":69,"context_line":"                    \"type\": \"number\","},{"line_number":70,"context_line":"                    \"default\": 1"},{"line_number":71,"context_line":"                },"},{"line_number":72,"context_line":"            },"},{"line_number":73,"context_line":"        }"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def add_action_poweronoff_node(self, node_uuid, state):"},{"line_number":76,"context_line":"        \"\"\"Add an action for node disability into the solution."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_2e889b1d","line":73,"range":{"start_line":59,"start_character":0,"end_line":73,"end_character":9},"in_reply_to":"5f201791_7ca6ba55","updated":"2017-07-01 09:27:29.000000000","message":"Done","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"9a03484576a32fa6197f5e95585fa8ea38de1978","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @classmethod"},{"line_number":58,"context_line":"    def get_schema(cls):"},{"line_number":59,"context_line":"        # Mandatory default setting for each element"},{"line_number":60,"context_line":"        return {"},{"line_number":61,"context_line":"            \"properties\": {"},{"line_number":62,"context_line":"                \"free_used_percent\": {"},{"line_number":63,"context_line":"                    \"description\": \"workload threshold for balance\","},{"line_number":64,"context_line":"                    \"type\": \"number\","},{"line_number":65,"context_line":"                    \"default\": 10.0"},{"line_number":66,"context_line":"                },"},{"line_number":67,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":68,"context_line":"                    \"description\": \"Number of free hosts\","},{"line_number":69,"context_line":"                    \"type\": \"number\","},{"line_number":70,"context_line":"                    \"default\": 1"},{"line_number":71,"context_line":"                },"},{"line_number":72,"context_line":"            },"},{"line_number":73,"context_line":"        }"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def add_action_poweronoff_node(self, node_uuid, state):"},{"line_number":76,"context_line":"        \"\"\"Add an action for node disability into the solution."}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_4e83d705","line":73,"range":{"start_line":59,"start_character":0,"end_line":73,"end_character":9},"in_reply_to":"5f201791_f5f9f4c7","updated":"2017-07-01 09:27:29.000000000","message":"Done","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"58ec32e6f0b7a09ac1608dafa9d9b9fba33f64b7","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    @classmethod"},{"line_number":58,"context_line":"    def get_schema(cls):"},{"line_number":59,"context_line":"        # Mandatory default setting for each element"},{"line_number":60,"context_line":"        return {"},{"line_number":61,"context_line":"            \"properties\": {"},{"line_number":62,"context_line":"                \"free_used_percent\": {"},{"line_number":63,"context_line":"                    \"description\": \"workload threshold for balance\","},{"line_number":64,"context_line":"                    \"type\": \"number\","},{"line_number":65,"context_line":"                    \"default\": 10.0"},{"line_number":66,"context_line":"                },"},{"line_number":67,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":68,"context_line":"                    \"description\": \"Number of free hosts\","},{"line_number":69,"context_line":"                    \"type\": \"number\","},{"line_number":70,"context_line":"                    \"default\": 1"},{"line_number":71,"context_line":"                },"},{"line_number":72,"context_line":"            },"},{"line_number":73,"context_line":"        }"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def add_action_poweronoff_node(self, node_uuid, state):"},{"line_number":76,"context_line":"        \"\"\"Add an action for node disability into the solution."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_7ca6ba55","line":73,"range":{"start_line":59,"start_character":0,"end_line":73,"end_character":9},"in_reply_to":"5f201791_f5f9f4c7","updated":"2017-06-27 04:03:32.000000000","message":"agreed, IMHO please add description in comments and if possible add some meaningfull name","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"58ec32e6f0b7a09ac1608dafa9d9b9fba33f64b7","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            if (hypervisor_node[\u0027running_vms\u0027] \u003d\u003d 0):"},{"line_number":114,"context_line":"                if (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power on\u0027):"},{"line_number":115,"context_line":"                    self.free_poweron_pool.append(node_uuid)"},{"line_number":116,"context_line":"                elif (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power off\u0027):"},{"line_number":117,"context_line":"                    self.free_poweroff_pool.append(node_uuid)"},{"line_number":118,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_ddbdb1d8","line":115,"updated":"2017-06-27 04:03:32.000000000","message":"IMHO, can it be renamed to free_poweron_node or free_power_on_node_pool.","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"9a03484576a32fa6197f5e95585fa8ea38de1978","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            if (hypervisor_node[\u0027running_vms\u0027] \u003d\u003d 0):"},{"line_number":114,"context_line":"                if (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power on\u0027):"},{"line_number":115,"context_line":"                    self.free_poweron_pool.append(node_uuid)"},{"line_number":116,"context_line":"                elif (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power off\u0027):"},{"line_number":117,"context_line":"                    self.free_poweroff_pool.append(node_uuid)"},{"line_number":118,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_0e7ddf1b","line":115,"in_reply_to":"5f201791_ddbdb1d8","updated":"2017-07-01 09:27:29.000000000","message":"Done","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"58ec32e6f0b7a09ac1608dafa9d9b9fba33f64b7","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power on\u0027):"},{"line_number":115,"context_line":"                    self.free_poweron_pool.append(node_uuid)"},{"line_number":116,"context_line":"                elif (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power off\u0027):"},{"line_number":117,"context_line":"                    self.free_poweroff_pool.append(node_uuid)"},{"line_number":118,"context_line":"            else:"},{"line_number":119,"context_line":"                self.with_vms_pool.append(node_uuid)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_bdc2f557","line":117,"updated":"2017-06-27 04:03:32.000000000","message":"ditto","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"2bddc22ce710b0fb4191e8fc7c1bbe18f0fbe839","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            host_uuid \u003d compute_service.get(\u0027host\u0027)"},{"line_number":110,"context_line":"            if not self.compute_model.get_node_by_uuid(host_uuid):"},{"line_number":111,"context_line":"                continue"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            if (hypervisor_node[\u0027running_vms\u0027] \u003d\u003d 0):"},{"line_number":114,"context_line":"                if (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power on\u0027):"},{"line_number":115,"context_line":"                    self.free_poweron_pool.append(node_uuid)"},{"line_number":116,"context_line":"                elif (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power off\u0027):"},{"line_number":117,"context_line":"                    self.free_poweroff_pool.append(node_uuid)"},{"line_number":118,"context_line":"            else:"},{"line_number":119,"context_line":"                self.with_vms_pool.append(node_uuid)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        LOG.debug(\"with_vms_pool: %s\", self.with_vms_pool)"},{"line_number":122,"context_line":"        LOG.debug(\"free_poweron_pool: %s\", self.free_poweron_pool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b0e70a41","line":119,"range":{"start_line":112,"start_character":0,"end_line":119,"end_character":52},"updated":"2017-06-23 07:52:32.000000000","message":"These nodes in \u0027maintaining\u0027 state, or exclude in scope, should be filter out.","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"58ec32e6f0b7a09ac1608dafa9d9b9fba33f64b7","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            host_uuid \u003d compute_service.get(\u0027host\u0027)"},{"line_number":110,"context_line":"            if not self.compute_model.get_node_by_uuid(host_uuid):"},{"line_number":111,"context_line":"                continue"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            if (hypervisor_node[\u0027running_vms\u0027] \u003d\u003d 0):"},{"line_number":114,"context_line":"                if (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power on\u0027):"},{"line_number":115,"context_line":"                    self.free_poweron_pool.append(node_uuid)"},{"line_number":116,"context_line":"                elif (node_info[\u0027power_state\u0027] \u003d\u003d \u0027power off\u0027):"},{"line_number":117,"context_line":"                    self.free_poweroff_pool.append(node_uuid)"},{"line_number":118,"context_line":"            else:"},{"line_number":119,"context_line":"                self.with_vms_pool.append(node_uuid)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        LOG.debug(\"with_vms_pool: %s\", self.with_vms_pool)"},{"line_number":122,"context_line":"        LOG.debug(\"free_poweron_pool: %s\", self.free_poweron_pool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_3dcee581","line":119,"range":{"start_line":112,"start_character":0,"end_line":119,"end_character":52},"in_reply_to":"5f201791_b0e70a41","updated":"2017-06-27 04:03:32.000000000","message":"Explain all three pools in comments","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"2bddc22ce710b0fb4191e8fc7c1bbe18f0fbe839","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \"\"\"Policy"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        random.shuffle(self.free_poweron_pool)"},{"line_number":130,"context_line":"        random.shuffle(self.free_poweroff_pool)"},{"line_number":131,"context_line":"        LOG.debug(\"after shuffle:\")"},{"line_number":132,"context_line":"        LOG.debug(\"free_poweron_pool: %s\", self.free_poweron_pool)"},{"line_number":133,"context_line":"        LOG.debug(\"free_poweroff_pool: %s\", self.free_poweroff_pool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_f0c6a29a","line":130,"range":{"start_line":129,"start_character":0,"end_line":130,"end_character":47},"updated":"2017-06-23 07:52:32.000000000","message":"Try random.sample().","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"9a03484576a32fa6197f5e95585fa8ea38de1978","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \"\"\"Policy"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        \"\"\""},{"line_number":129,"context_line":"        random.shuffle(self.free_poweron_pool)"},{"line_number":130,"context_line":"        random.shuffle(self.free_poweroff_pool)"},{"line_number":131,"context_line":"        LOG.debug(\"after shuffle:\")"},{"line_number":132,"context_line":"        LOG.debug(\"free_poweron_pool: %s\", self.free_poweron_pool)"},{"line_number":133,"context_line":"        LOG.debug(\"free_poweroff_pool: %s\", self.free_poweroff_pool)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_8927a9b7","line":130,"range":{"start_line":129,"start_character":0,"end_line":130,"end_character":47},"in_reply_to":"5f201791_f0c6a29a","updated":"2017-07-01 09:27:29.000000000","message":"IMHO, random.shuffle() is used to disrupt the order of elements in a list, while random.sample(sequence,k) is to obtain a fragment of a specified length from a sequence. I didn\u0027t understand why you recommend random.sample() here? Can you explain it?","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":19457,"name":"aditi sharma","email":"adi.sky17@gmail.com","username":"aditi"},"change_message_id":"58ec32e6f0b7a09ac1608dafa9d9b9fba33f64b7","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        This can be used to fetch some pre-requisites or data."},{"line_number":155,"context_line":"        \"\"\""},{"line_number":156,"context_line":"        LOG.info(_LI(\"Initializing Saving Energy Strategy\"))"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        if not self.compute_model:"},{"line_number":159,"context_line":"            raise wexc.ClusterStateNotDefined()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_7df57dec","line":156,"updated":"2017-06-27 04:03:32.000000000","message":"Log translations are not used anymore, please remove it","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"9a03484576a32fa6197f5e95585fa8ea38de1978","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        This can be used to fetch some pre-requisites or data."},{"line_number":155,"context_line":"        \"\"\""},{"line_number":156,"context_line":"        LOG.info(_LI(\"Initializing Saving Energy Strategy\"))"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        if not self.compute_model:"},{"line_number":159,"context_line":"            raise wexc.ClusterStateNotDefined()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f1d235d_e9373de3","line":156,"in_reply_to":"5f201791_7df57dec","updated":"2017-07-01 09:27:29.000000000","message":"Done","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"2bddc22ce710b0fb4191e8fc7c1bbe18f0fbe839","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        if self.compute_model.stale:"},{"line_number":162,"context_line":"            raise wexc.ClusterStateStale()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        self.free_used_percent \u003d self.input_parameters.free_used_percent"},{"line_number":165,"context_line":"        self.min_free_hosts_num \u003d self.input_parameters.min_free_hosts_num"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        LOG.debug(self.compute_model.to_string())"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b5501c5f","line":165,"range":{"start_line":163,"start_character":0,"end_line":165,"end_character":74},"updated":"2017-06-23 07:52:32.000000000","message":"Dealing with input parameters is better to put into do_execute.","commit_id":"b989b3184e37395019d75ff86f48fde164dea528"},{"author":{"_account_id":24501,"name":"sue","display_name":"suzhengwei","email":"sugar-2008@163.com","username":"suzhengwei"},"change_message_id":"f8fa19102d7c0a2a48aa5d450103cf4e035511db","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        \"\"\"Policy"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":"        random.shuffle(self.free_poweron_node_pool)"},{"line_number":146,"context_line":"        random.shuffle(self.free_poweroff_node_pool)"},{"line_number":147,"context_line":"        LOG.debug(\"after shuffle:\")"},{"line_number":148,"context_line":"        LOG.debug(\"free_poweron_node_pool: %s\", self.free_poweron_node_pool)"},{"line_number":149,"context_line":"        LOG.debug(\"free_poweroff_node_pool: %s\", self.free_poweroff_node_pool)"},{"line_number":150,"context_line":"        need_poweron \u003d max("},{"line_number":151,"context_line":"            (len(self.with_vms_node_pool) * self.free_used_percent / 100), ("},{"line_number":152,"context_line":"                self.min_free_hosts_num))"},{"line_number":153,"context_line":"        len_poweron \u003d len(self.free_poweron_node_pool)"},{"line_number":154,"context_line":"        len_poweroff \u003d len(self.free_poweroff_node_pool)"},{"line_number":155,"context_line":"        if len_poweron \u003e need_poweron:"},{"line_number":156,"context_line":"            for index in range(len_poweron - need_poweron):"},{"line_number":157,"context_line":"                node_uuid \u003d self.free_poweron_node_pool[index]"},{"line_number":158,"context_line":"                self.add_action_poweronoff_node(node_uuid, \u0027off\u0027)"},{"line_number":159,"context_line":"                LOG.debug(\"power off %s\", node_uuid)"},{"line_number":160,"context_line":"        elif len_poweron \u003c need_poweron:"},{"line_number":161,"context_line":"            diff \u003d need_poweron - len_poweron"},{"line_number":162,"context_line":"            for index in range(min(len_poweroff, diff)):"},{"line_number":163,"context_line":"                node_uuid \u003d self.free_poweroff_node_pool[index]"},{"line_number":164,"context_line":"                self.add_action_poweronoff_node(node_uuid, \u0027on\u0027)"},{"line_number":165,"context_line":"                LOG.debug(\"power on %s\", node_uuid)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def pre_execute(self):"},{"line_number":168,"context_line":"        \"\"\"Pre-execution phase"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f1d235d_47a7ca50","line":165,"range":{"start_line":145,"start_character":0,"end_line":165,"end_character":51},"updated":"2017-07-04 03:18:31.000000000","message":"I know your means. You want to disrupts the pools first then select needed nodes to power-on or power-off.\nIt could be more brief. Random.sample helps select needed nodes from the pools at random. No need to  disrupt them. Like this:\nif len_poweron \u003e need_poweron:\n  for node in random.sample(free_poweron_pool, len_poweron-need_poweron):\n    self.add_action_poweronoff_node(node, \u0027off\u0027)\nelif ...","commit_id":"c83a75fe5db52ec4c3cd60f2e873be16812d4e7a"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"066bef43e6f15ede729611565740ecb4a51899b5","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        \"\"\"Policy"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":"        random.shuffle(self.free_poweron_node_pool)"},{"line_number":146,"context_line":"        random.shuffle(self.free_poweroff_node_pool)"},{"line_number":147,"context_line":"        LOG.debug(\"after shuffle:\")"},{"line_number":148,"context_line":"        LOG.debug(\"free_poweron_node_pool: %s\", self.free_poweron_node_pool)"},{"line_number":149,"context_line":"        LOG.debug(\"free_poweroff_node_pool: %s\", self.free_poweroff_node_pool)"},{"line_number":150,"context_line":"        need_poweron \u003d max("},{"line_number":151,"context_line":"            (len(self.with_vms_node_pool) * self.free_used_percent / 100), ("},{"line_number":152,"context_line":"                self.min_free_hosts_num))"},{"line_number":153,"context_line":"        len_poweron \u003d len(self.free_poweron_node_pool)"},{"line_number":154,"context_line":"        len_poweroff \u003d len(self.free_poweroff_node_pool)"},{"line_number":155,"context_line":"        if len_poweron \u003e need_poweron:"},{"line_number":156,"context_line":"            for index in range(len_poweron - need_poweron):"},{"line_number":157,"context_line":"                node_uuid \u003d self.free_poweron_node_pool[index]"},{"line_number":158,"context_line":"                self.add_action_poweronoff_node(node_uuid, \u0027off\u0027)"},{"line_number":159,"context_line":"                LOG.debug(\"power off %s\", node_uuid)"},{"line_number":160,"context_line":"        elif len_poweron \u003c need_poweron:"},{"line_number":161,"context_line":"            diff \u003d need_poweron - len_poweron"},{"line_number":162,"context_line":"            for index in range(min(len_poweroff, diff)):"},{"line_number":163,"context_line":"                node_uuid \u003d self.free_poweroff_node_pool[index]"},{"line_number":164,"context_line":"                self.add_action_poweronoff_node(node_uuid, \u0027on\u0027)"},{"line_number":165,"context_line":"                LOG.debug(\"power on %s\", node_uuid)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def pre_execute(self):"},{"line_number":168,"context_line":"        \"\"\"Pre-execution phase"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f1d235d_384d01c4","line":165,"range":{"start_line":145,"start_character":0,"end_line":165,"end_character":51},"in_reply_to":"3f1d235d_47a7ca50","updated":"2017-07-04 12:09:17.000000000","message":"Done","commit_id":"c83a75fe5db52ec4c3cd60f2e873be16812d4e7a"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        return {"},{"line_number":77,"context_line":"            \"properties\": {"},{"line_number":78,"context_line":"                \"free_used_percent\": {"},{"line_number":79,"context_line":"                    \"description\": (\"a ration number, which describes the\""},{"line_number":80,"context_line":"                                    \"quotient of standy_nodes/nodes_with_VMs\"),"},{"line_number":81,"context_line":"                    \"type\": \"number\","},{"line_number":82,"context_line":"                    \"default\": 10.0"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_55dc7f45","line":79,"updated":"2017-07-12 13:20:15.000000000","message":"need space","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        return {"},{"line_number":77,"context_line":"            \"properties\": {"},{"line_number":78,"context_line":"                \"free_used_percent\": {"},{"line_number":79,"context_line":"                    \"description\": (\"a ration number, which describes the\""},{"line_number":80,"context_line":"                                    \"quotient of standy_nodes/nodes_with_VMs\"),"},{"line_number":81,"context_line":"                    \"type\": \"number\","},{"line_number":82,"context_line":"                    \"default\": 10.0"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_95bb37e4","line":79,"range":{"start_line":79,"start_character":39,"end_line":79,"end_character":45},"updated":"2017-07-12 13:20:15.000000000","message":"rational?","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            \"properties\": {"},{"line_number":78,"context_line":"                \"free_used_percent\": {"},{"line_number":79,"context_line":"                    \"description\": (\"a ration number, which describes the\""},{"line_number":80,"context_line":"                                    \"quotient of standy_nodes/nodes_with_VMs\"),"},{"line_number":81,"context_line":"                    \"type\": \"number\","},{"line_number":82,"context_line":"                    \"default\": 10.0"},{"line_number":83,"context_line":"                },"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_70f2e908","line":80,"range":{"start_line":80,"start_character":37,"end_line":80,"end_character":76},"updated":"2017-07-12 13:20:15.000000000","message":"I understand standy(standby) nodes is \"min_free_hosts_num\".\nIf that is true, we can use nodes_with_VMs as parameter because rational number is not intuitive. Or please explain what nodes_with_VMs is, because this is shown by CLI.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                    \"type\": \"number\","},{"line_number":82,"context_line":"                    \"default\": 10.0"},{"line_number":83,"context_line":"                },"},{"line_number":84,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":85,"context_line":"                    \"description\": \"Number of standy_nodes\","},{"line_number":86,"context_line":"                    \"type\": \"number\","},{"line_number":87,"context_line":"                    \"default\": 1"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_b5a75350","line":84,"range":{"start_line":84,"start_character":17,"end_line":84,"end_character":35},"updated":"2017-07-12 13:20:15.000000000","message":"Why is this named \"num_of_standby_nodes\" or \"standby_nodes\" in accordance with description? Or change description because this is shown by CLI.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                    \"default\": 10.0"},{"line_number":83,"context_line":"                },"},{"line_number":84,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":85,"context_line":"                    \"description\": \"Number of standy_nodes\","},{"line_number":86,"context_line":"                    \"type\": \"number\","},{"line_number":87,"context_line":"                    \"default\": 1"},{"line_number":88,"context_line":"                },"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_d591aff3","line":85,"range":{"start_line":85,"start_character":52,"end_line":85,"end_character":53},"updated":"2017-07-12 13:20:15.000000000","message":"not required.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                    \"default\": 10.0"},{"line_number":83,"context_line":"                },"},{"line_number":84,"context_line":"                \"min_free_hosts_num\": {"},{"line_number":85,"context_line":"                    \"description\": \"Number of standy_nodes\","},{"line_number":86,"context_line":"                    \"type\": \"number\","},{"line_number":87,"context_line":"                    \"default\": 1"},{"line_number":88,"context_line":"                },"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_75665b54","line":85,"range":{"start_line":85,"start_character":46,"end_line":85,"end_character":52},"updated":"2017-07-12 13:20:15.000000000","message":"standby?","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        free_poweroff_node_pool."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        :para with_vms_node_pool: pool for nodes with VMs running on it"},{"line_number":111,"context_line":"        :para free_poweron_node_pool:pool for nodes without VMs running on it"},{"line_number":112,"context_line":"                                    but still powered on"},{"line_number":113,"context_line":"        :para free_poweroff_node_pool: pool for nodes without VMs running on it"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_55a47f08","line":110,"range":{"start_line":110,"start_character":9,"end_line":110,"end_character":13},"updated":"2017-07-12 13:20:15.000000000","message":"param?","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        free_poweroff_node_pool."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        :para with_vms_node_pool: pool for nodes with VMs running on it"},{"line_number":111,"context_line":"        :para free_poweron_node_pool:pool for nodes without VMs running on it"},{"line_number":112,"context_line":"                                    but still powered on"},{"line_number":113,"context_line":"        :para free_poweroff_node_pool: pool for nodes without VMs running on it"},{"line_number":114,"context_line":"                                       and powered off"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_f5aa6bd0","line":111,"range":{"start_line":111,"start_character":9,"end_line":111,"end_character":13},"updated":"2017-07-12 13:20:15.000000000","message":"ditto","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        :para with_vms_node_pool: pool for nodes with VMs running on it"},{"line_number":111,"context_line":"        :para free_poweron_node_pool:pool for nodes without VMs running on it"},{"line_number":112,"context_line":"                                    but still powered on"},{"line_number":113,"context_line":"        :para free_poweroff_node_pool: pool for nodes without VMs running on it"},{"line_number":114,"context_line":"                                       and powered off"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_557d9f6c","line":113,"range":{"start_line":113,"start_character":9,"end_line":113,"end_character":13},"updated":"2017-07-12 13:20:15.000000000","message":"ditto","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            node_info \u003d self.ironic_client.node.get(node_uuid).to_dict()"},{"line_number":122,"context_line":"            hypervisor_id \u003d node_info[\u0027extra\u0027].get(\u0027compute_node_id\u0027, None)"},{"line_number":123,"context_line":"            if hypervisor_id is None:"},{"line_number":124,"context_line":"                LOG.error(_(\u0027Cannot find compute_node_id in extra \u0027"},{"line_number":125,"context_line":"                          \u0027of ironic node %s, \u0027), node_uuid)"},{"line_number":126,"context_line":"                continue"},{"line_number":127,"context_line":"            hypervisor_node \u003d self.nova_client.hypervisors.get(hypervisor_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_95e8d716","line":124,"range":{"start_line":124,"start_character":26,"end_line":124,"end_character":27},"updated":"2017-07-12 13:20:15.000000000","message":"_ is not needed.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            node_info \u003d self.ironic_client.node.get(node_uuid).to_dict()"},{"line_number":122,"context_line":"            hypervisor_id \u003d node_info[\u0027extra\u0027].get(\u0027compute_node_id\u0027, None)"},{"line_number":123,"context_line":"            if hypervisor_id is None:"},{"line_number":124,"context_line":"                LOG.error(_(\u0027Cannot find compute_node_id in extra \u0027"},{"line_number":125,"context_line":"                          \u0027of ironic node %s, \u0027), node_uuid)"},{"line_number":126,"context_line":"                continue"},{"line_number":127,"context_line":"            hypervisor_node \u003d self.nova_client.hypervisors.get(hypervisor_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_75641bba","line":124,"range":{"start_line":124,"start_character":20,"end_line":124,"end_character":25},"updated":"2017-07-12 13:20:15.000000000","message":"error but continue is bad.\nif this method really continue, warning is better.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            hypervisor_id \u003d node_info[\u0027extra\u0027].get(\u0027compute_node_id\u0027, None)"},{"line_number":123,"context_line":"            if hypervisor_id is None:"},{"line_number":124,"context_line":"                LOG.error(_(\u0027Cannot find compute_node_id in extra \u0027"},{"line_number":125,"context_line":"                          \u0027of ironic node %s, \u0027), node_uuid)"},{"line_number":126,"context_line":"                continue"},{"line_number":127,"context_line":"            hypervisor_node \u003d self.nova_client.hypervisors.get(hypervisor_id)"},{"line_number":128,"context_line":"            if hypervisor_node is None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_f5d82b80","line":125,"range":{"start_line":125,"start_character":44,"end_line":125,"end_character":45},"updated":"2017-07-12 13:20:15.000000000","message":"extra ,","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                continue"},{"line_number":127,"context_line":"            hypervisor_node \u003d self.nova_client.hypervisors.get(hypervisor_id)"},{"line_number":128,"context_line":"            if hypervisor_node is None:"},{"line_number":129,"context_line":"                LOG.error(_(\u0027Cannot find hypervisor %s, \u0027), hypervisor_id)"},{"line_number":130,"context_line":"                continue"},{"line_number":131,"context_line":"            hypervisor_node \u003d hypervisor_node.to_dict()"},{"line_number":132,"context_line":"            compute_service \u003d hypervisor_node.get(\u0027service\u0027, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_d5be4ffe","line":129,"range":{"start_line":129,"start_character":26,"end_line":129,"end_character":27},"updated":"2017-07-12 13:20:15.000000000","message":"_ is not needed.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                continue"},{"line_number":127,"context_line":"            hypervisor_node \u003d self.nova_client.hypervisors.get(hypervisor_id)"},{"line_number":128,"context_line":"            if hypervisor_node is None:"},{"line_number":129,"context_line":"                LOG.error(_(\u0027Cannot find hypervisor %s, \u0027), hypervisor_id)"},{"line_number":130,"context_line":"                continue"},{"line_number":131,"context_line":"            hypervisor_node \u003d hypervisor_node.to_dict()"},{"line_number":132,"context_line":"            compute_service \u003d hypervisor_node.get(\u0027service\u0027, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_355ea3e6","line":129,"range":{"start_line":129,"start_character":20,"end_line":129,"end_character":25},"updated":"2017-07-12 13:20:15.000000000","message":"error but continue is bad.\nif this method really continue, warning is better.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        This can be used to fetch some pre-requisites or data."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":"        LOG.info(_(\"Initializing Saving Energy Strategy\"))"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        if not self.compute_model:"},{"line_number":176,"context_line":"            raise wexc.ClusterStateNotDefined()"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_355b432f","line":173,"range":{"start_line":173,"start_character":17,"end_line":173,"end_character":18},"updated":"2017-07-12 13:20:15.000000000","message":"_ is not needed.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        This phase is where you should put the main logic of your strategy."},{"line_number":187,"context_line":"        \"\"\""},{"line_number":188,"context_line":"        self.ironic_client \u003d self.osc.ironic()"},{"line_number":189,"context_line":"        self.nova_client \u003d self.osc.nova()"},{"line_number":190,"context_line":"        self.free_used_percent \u003d self.input_parameters.free_used_percent"},{"line_number":191,"context_line":"        self.min_free_hosts_num \u003d self.input_parameters.min_free_hosts_num"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_f2096131","line":188,"range":{"start_line":188,"start_character":8,"end_line":188,"end_character":46},"updated":"2017-07-12 13:20:15.000000000","message":"This does not need because ironic_client method is defined as property.","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        This phase is where you should put the main logic of your strategy."},{"line_number":187,"context_line":"        \"\"\""},{"line_number":188,"context_line":"        self.ironic_client \u003d self.osc.ironic()"},{"line_number":189,"context_line":"        self.nova_client \u003d self.osc.nova()"},{"line_number":190,"context_line":"        self.free_used_percent \u003d self.input_parameters.free_used_percent"},{"line_number":191,"context_line":"        self.min_free_hosts_num \u003d self.input_parameters.min_free_hosts_num"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_d2066521","line":189,"range":{"start_line":189,"start_character":8,"end_line":189,"end_character":42},"updated":"2017-07-12 13:20:15.000000000","message":"ditto","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"acd20b5d12821ddbcbc05488641a9dd59d1f007f","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        \"\"\""},{"line_number":177,"context_line":"        LOG.info(\"Initializing Saving Energy Strategy\")"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        if not self.compute_model:"},{"line_number":180,"context_line":"            raise wexc.ClusterStateNotDefined()"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if self.compute_model.stale:"},{"line_number":183,"context_line":"            raise wexc.ClusterStateStale()"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        LOG.debug(self.compute_model.to_string())"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def do_execute(self):"},{"line_number":188,"context_line":"        \"\"\"Strategy execution phase"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff346bd7_8e41613c","line":185,"range":{"start_line":179,"start_character":8,"end_line":185,"end_character":49},"updated":"2017-07-26 08:12:12.000000000","message":"This strategy does not use compute_model. These code is meaningless. Even if this strategy uses compute model, these code is called by calling self.compute_model, see https://github.com/openstack/watcher/blob/master/watcher/decision_engine/strategy/strategies/base.py#L182-L192","commit_id":"9055fd3395c958429a79acad097119816f38a121"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"acd20b5d12821ddbcbc05488641a9dd59d1f007f","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        This can be used to compute the global efficacy"},{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        self.solution.model \u003d self.compute_model"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        LOG.debug(self.compute_model.to_string())"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff346bd7_ee634db0","line":205,"range":{"start_line":203,"start_character":7,"end_line":205,"end_character":49},"updated":"2017-07-26 08:12:12.000000000","message":"This strategy does not use compute_model.\nSpec about this strategy does not refer to global efficacy indicator, so simply pass.","commit_id":"9055fd3395c958429a79acad097119816f38a121"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"a707d50634411e960eae8166026e25cc87803d46","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        free_poweroff_node_pool."},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        :param with_vms_node_pool: pool for nodes with VMs running on it"},{"line_number":114,"context_line":"        :param free_poweron_node_pool: pool for nodes without VMs running on it"},{"line_number":115,"context_line":"                                       but still powered on"},{"line_number":116,"context_line":"        :param free_poweroff_node_pool: pool for nodes without VMs and"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff346bd7_7f8fed74","line":113,"range":{"start_line":113,"start_character":8,"end_line":113,"end_character":14},"updated":"2017-07-26 23:27:10.000000000","message":"This method does not have any parameters.\nPlease remove :param","commit_id":"90edcb57daab84e8e0430518747a1f99f1caa89c"},{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"2411c62b88f2dfdb8f12fe2b5ac5ad54d15f64a1","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                LOG.warning((\u0027Cannot find hypervisor %s\u0027), hypervisor_id)"},{"line_number":127,"context_line":"                continue"},{"line_number":128,"context_line":"            hypervisor_node \u003d hypervisor_node.to_dict()"},{"line_number":129,"context_line":"            compute_service \u003d hypervisor_node.get(\u0027service\u0027, None)"},{"line_number":130,"context_line":"            host_uuid \u003d compute_service.get(\u0027host\u0027)"},{"line_number":131,"context_line":"            if not self.compute_model.get_node_by_uuid(host_uuid):"},{"line_number":132,"context_line":"                continue"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"            if not (hypervisor_node.get(\u0027state\u0027) \u003d\u003d \u0027up\u0027):"},{"line_number":135,"context_line":"                \"\"\"filter nodes that are not in \u0027up\u0027 state\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"ff346bd7_fe48752d","line":132,"range":{"start_line":129,"start_character":12,"end_line":132,"end_character":24},"updated":"2017-07-27 06:55:48.000000000","message":"compute_model.get_node_by_uuid is doing nova.hypervisors.get internally. could you teach me why this code is needed?","commit_id":"8859ea889b1093cf0dcec28992934e4cea150cbf"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"86c8afc88b74885535f2f20acb70885334978fdf","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                LOG.warning((\u0027Cannot find hypervisor %s\u0027), hypervisor_id)"},{"line_number":127,"context_line":"                continue"},{"line_number":128,"context_line":"            hypervisor_node \u003d hypervisor_node.to_dict()"},{"line_number":129,"context_line":"            compute_service \u003d hypervisor_node.get(\u0027service\u0027, None)"},{"line_number":130,"context_line":"            host_uuid \u003d compute_service.get(\u0027host\u0027)"},{"line_number":131,"context_line":"            if not self.compute_model.get_node_by_uuid(host_uuid):"},{"line_number":132,"context_line":"                continue"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"            if not (hypervisor_node.get(\u0027state\u0027) \u003d\u003d \u0027up\u0027):"},{"line_number":135,"context_line":"                \"\"\"filter nodes that are not in \u0027up\u0027 state\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"ff346bd7_3ee95db6","line":132,"range":{"start_line":129,"start_character":12,"end_line":132,"end_character":24},"in_reply_to":"ff346bd7_fe48752d","updated":"2017-07-27 07:09:56.000000000","message":"This is to make sure this strategy only works on nodes within the scope of this audit.","commit_id":"8859ea889b1093cf0dcec28992934e4cea150cbf"}],"watcher/tests/decision_engine/strategy/strategies/test_saving_energy.py":[{"author":{"_account_id":13111,"name":"Hidekazu Nakamura","email":"hidekazuna@gmail.com","username":"hid-nakamura"},"change_message_id":"8f05ffc7d740859544e5b92adb255b93d661a469","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        action \u003d self.strategy.solution.actions[0]"},{"line_number":185,"context_line":"        self.assertEqual(action.get(\u0027input_parameters\u0027).get(\u0027state\u0027), \u0027off\u0027)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"#    def test_execute(self):"},{"line_number":188,"context_line":"#        mock_node1 \u003d mock.Mock()"},{"line_number":189,"context_line":"#        mock_node2 \u003d mock.Mock()"},{"line_number":190,"context_line":"#        mock_node1.to_dict.return_value \u003d {"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_d0509dd7","line":187,"range":{"start_line":187,"start_character":0,"end_line":187,"end_character":27},"updated":"2017-07-12 13:20:15.000000000","message":"Please test do_execute..","commit_id":"84cb3acfa5eaa7a10e32d132f5d7c680cc5ed7c7"}]}
