)]}'
{"ironic/drivers/modules/ipmitool.py":[{"author":{"_account_id":13997,"name":"SHIGEMATSU Mitsuhiro","email":"shigematsu.mitsuhiro@lab.ntt.co.jp","username":"pshige"},"change_message_id":"c394a9919cacd53a08f9a03e1f47b43ddb64b430","unresolved":false,"context_lines":[{"line_number":502,"context_line":""},{"line_number":503,"context_line":"        try:"},{"line_number":504,"context_line":"            conductor_utils.chan(node_uuid).get(block\u003dFalse)"},{"line_number":505,"context_line":"            LOG.debug(\u0027Channel of node %(node)s got cancel messsage.\u0027,"},{"line_number":506,"context_line":"                      {\u0027node\u0027: node_uuid})"},{"line_number":507,"context_line":"            raise loopingcall.LoopingCallDone()"},{"line_number":508,"context_line":"        except queue.Empty:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_20c9a359","line":505,"updated":"2015-08-25 17:24:58.000000000","message":"s/messsage/message/","commit_id":"e1896c5104d883d087e30900926e87ac908fea44"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"1c3722c43fddc8104a7184827b801a253d1fa605","unresolved":false,"context_lines":[{"line_number":502,"context_line":""},{"line_number":503,"context_line":"        try:"},{"line_number":504,"context_line":"            conductor_utils.chan(node_uuid).get(block\u003dFalse)"},{"line_number":505,"context_line":"            LOG.debug(\u0027Channel of node %(node)s got cancel messsage.\u0027,"},{"line_number":506,"context_line":"                      {\u0027node\u0027: node_uuid})"},{"line_number":507,"context_line":"            raise loopingcall.LoopingCallDone()"},{"line_number":508,"context_line":"        except queue.Empty:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_c1b76d83","line":505,"in_reply_to":"fa1b9901_20c9a359","updated":"2015-08-26 08:34:03.000000000","message":"I\u0027ll fix that.","commit_id":"e1896c5104d883d087e30900926e87ac908fea44"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"cdc030f97c475feb4c6d27d32a8693fc4c691e36","unresolved":false,"context_lines":[{"line_number":491,"context_line":"    if new_state \u003d\u003d states.POWER_ON:"},{"line_number":492,"context_line":"        cmd_name \u003d \"on\""},{"line_number":493,"context_line":"        target_state \u003d states.POWER_ON"},{"line_number":494,"context_line":"        retry_timeout \u003d CONF.ipmi.retry_timeout"},{"line_number":495,"context_line":"    elif new_state \u003d\u003d states.POWER_OFF:"},{"line_number":496,"context_line":"        cmd_name \u003d \"off\""},{"line_number":497,"context_line":"        target_state \u003d states.POWER_OFF"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_17ec2528","line":494,"range":{"start_line":494,"start_character":9,"end_line":494,"end_character":47},"updated":"2016-06-29 10:30:08.000000000","message":"Perhaps this could be set outside the if block, and then overridden in the soft case.","commit_id":"7feda8fb98ff426338883846491adda98c725dc5"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2a9d7e0df7a4cc578f08fb4be26c67b63925bc3d","unresolved":false,"context_lines":[{"line_number":491,"context_line":"    if new_state \u003d\u003d states.POWER_ON:"},{"line_number":492,"context_line":"        cmd_name \u003d \"on\""},{"line_number":493,"context_line":"        target_state \u003d states.POWER_ON"},{"line_number":494,"context_line":"        retry_timeout \u003d CONF.ipmi.retry_timeout"},{"line_number":495,"context_line":"    elif new_state \u003d\u003d states.POWER_OFF:"},{"line_number":496,"context_line":"        cmd_name \u003d \"off\""},{"line_number":497,"context_line":"        target_state \u003d states.POWER_OFF"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_cd4e2537","line":494,"range":{"start_line":494,"start_character":9,"end_line":494,"end_character":47},"in_reply_to":"3aaa91ec_17ec2528","updated":"2016-07-01 04:11:29.000000000","message":"I\u0027ll certainly consider it. Great thanks, Doug!","commit_id":"7feda8fb98ff426338883846491adda98c725dc5"},{"author":{"_account_id":20522,"name":"Aline Bousquet","email":"albousque@gmail.com","username":"alineb"},"change_message_id":"3648640fbf145c3877eec65d4b30a85f53f51f2e","unresolved":false,"context_lines":[{"line_number":492,"context_line":"    elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":493,"context_line":"        cmd_name \u003d \"soft\""},{"line_number":494,"context_line":"        target_state \u003d states.POWER_OFF"},{"line_number":495,"context_line":"        retry_timeout \u003d timeout"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _wait(mutable):"},{"line_number":498,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_439f7550","line":495,"updated":"2016-08-02 15:02:45.000000000","message":"Why do you set retry_timeout here? Isn\u0027t it already set from line 484?","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"621fc666b418d5628d71975e69bf2ce25d43b3d3","unresolved":false,"context_lines":[{"line_number":492,"context_line":"    elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":493,"context_line":"        cmd_name \u003d \"soft\""},{"line_number":494,"context_line":"        target_state \u003d states.POWER_OFF"},{"line_number":495,"context_line":"        retry_timeout \u003d timeout"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def _wait(mutable):"},{"line_number":498,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_8d9f7302","line":495,"in_reply_to":"bacf61ea_439f7550","updated":"2016-08-04 09:42:08.000000000","message":"Good question! In case of soft power off, the timeout value is set at the base patch:\n\nL.178 \nhttps://review.openstack.org/#/c/216730/6/ironic/conductor/manager.py","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":20522,"name":"Aline Bousquet","email":"albousque@gmail.com","username":"alineb"},"change_message_id":"3648640fbf145c3877eec65d4b30a85f53f51f2e","unresolved":false,"context_lines":[{"line_number":806,"context_line":""},{"line_number":807,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":808,"context_line":"        :param new_state: desired power state."},{"line_number":809,"context_line":"            one of ironic.common.states POWER_ON, POWER_OFF, SOFT_POWER_OFF."},{"line_number":810,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":811,"context_line":"          ``None`` indicates to use default timeout."},{"line_number":812,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_e88648da","line":809,"updated":"2016-08-02 15:02:45.000000000","message":"I think SOFT_REBOOT is missing here.","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"621fc666b418d5628d71975e69bf2ce25d43b3d3","unresolved":false,"context_lines":[{"line_number":806,"context_line":""},{"line_number":807,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":808,"context_line":"        :param new_state: desired power state."},{"line_number":809,"context_line":"            one of ironic.common.states POWER_ON, POWER_OFF, SOFT_POWER_OFF."},{"line_number":810,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":811,"context_line":"          ``None`` indicates to use default timeout."},{"line_number":812,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_6d703fdd","line":809,"in_reply_to":"bacf61ea_e88648da","updated":"2016-08-04 09:42:08.000000000","message":"I\u0027ll fix that.","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":20522,"name":"Aline Bousquet","email":"albousque@gmail.com","username":"alineb"},"change_message_id":"3648640fbf145c3877eec65d4b30a85f53f51f2e","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        else:"},{"line_number":834,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":835,"context_line":"                _(\"set_power_state called \""},{"line_number":836,"context_line":"                  \"with invalid power state %s.\") % new_state)"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":"        if state !\u003d target_state:"},{"line_number":839,"context_line":"            raise exception.PowerStateFailure(pstate\u003dtarget_state)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_487674d9","line":836,"updated":"2016-08-02 15:02:45.000000000","message":"Maybe the error message could specify what are the valid power states?","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"621fc666b418d5628d71975e69bf2ce25d43b3d3","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        else:"},{"line_number":834,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":835,"context_line":"                _(\"set_power_state called \""},{"line_number":836,"context_line":"                  \"with invalid power state %s.\") % new_state)"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":"        if state !\u003d target_state:"},{"line_number":839,"context_line":"            raise exception.PowerStateFailure(pstate\u003dtarget_state)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_b86393dc","line":836,"in_reply_to":"bacf61ea_487674d9","updated":"2016-08-04 09:42:08.000000000","message":"Yes, we could. But I little bit hesitate to do so because changing exception message introduce compatibility issue which might affect customer\u0027s script or etc.","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13689,"name":"Hironori Shiina","email":"Hironori.Shiina@fujitsu.com","username":"shiina"},"change_message_id":"08db387956bb16d71ad57ad446345a51bbac5b67","unresolved":false,"context_lines":[{"line_number":501,"context_line":"    elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":502,"context_line":"        cmd_name \u003d \"soft\""},{"line_number":503,"context_line":"        target_state \u003d states.POWER_OFF"},{"line_number":504,"context_line":"        retry_timeout \u003d timeout"},{"line_number":505,"context_line":""},{"line_number":506,"context_line":"    def _wait(mutable):"},{"line_number":507,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_5954b4c8","line":504,"updated":"2016-09-27 23:43:07.000000000","message":"As I mentioned in another patch[1], it would be better to set timeout value in conf parameter here.\n\n[1] https://review.openstack.org/#/c/216730/12/ironic/conductor/manager.py@175","commit_id":"f89b144db57f9c00ebf6613af42c47b3f6aaaf16"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"b34ec268b22113d2afd7abd25426aeda27d113d4","unresolved":false,"context_lines":[{"line_number":501,"context_line":"    elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":502,"context_line":"        cmd_name \u003d \"soft\""},{"line_number":503,"context_line":"        target_state \u003d states.POWER_OFF"},{"line_number":504,"context_line":"        retry_timeout \u003d timeout"},{"line_number":505,"context_line":""},{"line_number":506,"context_line":"    def _wait(mutable):"},{"line_number":507,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_2e0ea5e5","line":504,"in_reply_to":"5a8bc5a2_5954b4c8","updated":"2016-09-28 01:34:02.000000000","message":"iRMC code is wrong, I\u0027ll fix the iRMC code so as to be consistent between both drivers.","commit_id":"f89b144db57f9c00ebf6613af42c47b3f6aaaf16"},{"author":{"_account_id":13689,"name":"Hironori Shiina","email":"Hironori.Shiina@fujitsu.com","username":"shiina"},"change_message_id":"08db387956bb16d71ad57ad446345a51bbac5b67","unresolved":false,"context_lines":[{"line_number":843,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":844,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":845,"context_line":"            _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":846,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":847,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":848,"context_line":"        else:"},{"line_number":849,"context_line":"            raise exception.InvalidParameterValue("}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_60bd3501","line":846,"updated":"2016-09-27 23:43:07.000000000","message":"Isn\u0027t it necessary to call driver_utils.ensure_next_boot_device() ?","commit_id":"f89b144db57f9c00ebf6613af42c47b3f6aaaf16"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"b34ec268b22113d2afd7abd25426aeda27d113d4","unresolved":false,"context_lines":[{"line_number":843,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":844,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":845,"context_line":"            _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":846,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":847,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":848,"context_line":"        else:"},{"line_number":849,"context_line":"            raise exception.InvalidParameterValue("}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_ae763504","line":846,"in_reply_to":"5a8bc5a2_60bd3501","updated":"2016-09-28 01:34:02.000000000","message":"Yes, good catch, thanks! I\u0027ll fix that.","commit_id":"f89b144db57f9c00ebf6613af42c47b3f6aaaf16"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"1d9b2d4535f3898eb00b638dd4afb50a2b2d5abe","unresolved":false,"context_lines":[{"line_number":501,"context_line":"    elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":502,"context_line":"        cmd_name \u003d \"soft\""},{"line_number":503,"context_line":"        target_state \u003d states.POWER_OFF"},{"line_number":504,"context_line":"        retry_timeout \u003d timeout"},{"line_number":505,"context_line":""},{"line_number":506,"context_line":"    def _wait(mutable):"},{"line_number":507,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a8bc5a2_b4f5a3cc","line":504,"range":{"start_line":504,"start_character":8,"end_line":504,"end_character":31},"updated":"2016-09-28 05:17:00.000000000","message":"It\u0027s redundant, but I\u0027m going to update this line like below so that timeout never be None:\n\n\u003e retry_timeout \u003d timeout or CONF.conductor.soft_power_off_timeout","commit_id":"592f76b241a78c6bffd4a78c73cb2d73e9966976"},{"author":{"_account_id":13689,"name":"Hironori Shiina","email":"Hironori.Shiina@fujitsu.com","username":"shiina"},"change_message_id":"f4ce0ef6baa553bfce9b18769b88d763fbd8091f","unresolved":false,"context_lines":[{"line_number":847,"context_line":"            target_state \u003d states.POWER_OFF"},{"line_number":848,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":849,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":850,"context_line":"            _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":851,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":852,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":853,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_e60fce34","line":850,"updated":"2016-10-14 14:42:14.000000000","message":"Isn\u0027t it necessary to see the result of _soft_power_off()?\nIt would be better to stop the action when soft_power_off fails.","commit_id":"02eaf243429e78d57007938b6367a93f0b0471cc"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bf92160060d6250542f22057babc6b63e37d2591","unresolved":false,"context_lines":[{"line_number":847,"context_line":"            target_state \u003d states.POWER_OFF"},{"line_number":848,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":849,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":850,"context_line":"            _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":851,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":852,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":853,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_8b8fd673","line":850,"in_reply_to":"fa6399be_e60fce34","updated":"2016-10-17 02:50:50.000000000","message":"I\u0027ll fix that.","commit_id":"02eaf243429e78d57007938b6367a93f0b0471cc"},{"author":{"_account_id":13689,"name":"Hironori Shiina","email":"Hironori.Shiina@fujitsu.com","username":"shiina"},"change_message_id":"f4ce0ef6baa553bfce9b18769b88d763fbd8091f","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        \"\"\""},{"line_number":876,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"},{"line_number":877,"context_line":"        _power_off(driver_info, timeout\u003dtimeout)"},{"line_number":878,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":879,"context_line":"        state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":880,"context_line":""},{"line_number":881,"context_line":"        if state !\u003d states.POWER_ON:"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_06d042f5","line":878,"updated":"2016-10-14 14:42:14.000000000","message":"The result of _power_off is also not checked.\nI prefer seeing the result here though this behavior is not made by this patch.","commit_id":"02eaf243429e78d57007938b6367a93f0b0471cc"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bf92160060d6250542f22057babc6b63e37d2591","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        \"\"\""},{"line_number":876,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"},{"line_number":877,"context_line":"        _power_off(driver_info, timeout\u003dtimeout)"},{"line_number":878,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":879,"context_line":"        state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":880,"context_line":""},{"line_number":881,"context_line":"        if state !\u003d states.POWER_ON:"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_2b7eca69","line":878,"in_reply_to":"fa6399be_06d042f5","updated":"2016-10-17 02:50:50.000000000","message":"This behavior should be corrected ASAP in another patch.","commit_id":"02eaf243429e78d57007938b6367a93f0b0471cc"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"16cc8ca79c4a948e3d789cbb1be61cdb5ddd3001","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        \"\"\""},{"line_number":876,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"},{"line_number":877,"context_line":"        _power_off(driver_info, timeout\u003dtimeout)"},{"line_number":878,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":879,"context_line":"        state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":880,"context_line":""},{"line_number":881,"context_line":"        if state !\u003d states.POWER_ON:"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_44ea0b75","line":878,"in_reply_to":"fa6399be_2b7eca69","updated":"2016-10-17 06:39:45.000000000","message":"submitted the patch:\n\nhttps://review.openstack.org/#/c/387181/","commit_id":"02eaf243429e78d57007938b6367a93f0b0471cc"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"e989d91570a4f09ba9a6672f599b0bd83b38a9e7","unresolved":false,"context_lines":[{"line_number":821,"context_line":"    @METRICS.timer(\u0027IPMIPower.set_power_state\u0027)"},{"line_number":822,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":823,"context_line":"    def set_power_state(self, task, new_state, timeout\u003dNone):"},{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, or soft off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."}],"source_content_type":"text/x-python","patch_set":13,"id":"da6895a0_16947be0","line":824,"range":{"start_line":824,"start_character":46,"end_line":824,"end_character":47},"updated":"2016-10-23 14:00:18.000000000","message":"soft reboot missed","commit_id":"05b9116afc2e9cfcd941a4e47d109a1bf01dbcf8"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"57a45f1bf60dc003350b409d6fc0d2be25c3b38c","unresolved":false,"context_lines":[{"line_number":821,"context_line":"    @METRICS.timer(\u0027IPMIPower.set_power_state\u0027)"},{"line_number":822,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":823,"context_line":"    def set_power_state(self, task, new_state, timeout\u003dNone):"},{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, or soft off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."}],"source_content_type":"text/x-python","patch_set":13,"id":"da6895a0_67dede6e","line":824,"range":{"start_line":824,"start_character":46,"end_line":824,"end_character":47},"in_reply_to":"da6895a0_16947be0","updated":"2016-10-24 01:15:34.000000000","message":"I\u0027ll fix that.","commit_id":"05b9116afc2e9cfcd941a4e47d109a1bf01dbcf8"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"e989d91570a4f09ba9a6672f599b0bd83b38a9e7","unresolved":false,"context_lines":[{"line_number":851,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":852,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":853,"context_line":"                raise exception.PowerStateFailure("},{"line_number":854,"context_line":"                    pstate\u003dintermediate_target_state)"},{"line_number":855,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":856,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":857,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6895a0_36917ff1","line":854,"range":{"start_line":854,"start_character":27,"end_line":854,"end_character":52},"updated":"2016-10-23 14:00:18.000000000","message":"It can be better if we can get diffrent exception message between poweroff failure and soft power off failure.","commit_id":"05b9116afc2e9cfcd941a4e47d109a1bf01dbcf8"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"57a45f1bf60dc003350b409d6fc0d2be25c3b38c","unresolved":false,"context_lines":[{"line_number":851,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":852,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":853,"context_line":"                raise exception.PowerStateFailure("},{"line_number":854,"context_line":"                    pstate\u003dintermediate_target_state)"},{"line_number":855,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":856,"context_line":"            target_state \u003d states.POWER_ON"},{"line_number":857,"context_line":"            state \u003d _power_on(driver_info, timeout\u003dtimeout)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da6895a0_a7e8f611","line":854,"range":{"start_line":854,"start_character":27,"end_line":854,"end_character":52},"in_reply_to":"da6895a0_36917ff1","updated":"2016-10-24 01:15:34.000000000","message":"I\u0027ll fix that.","commit_id":"05b9116afc2e9cfcd941a4e47d109a1bf01dbcf8"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"71f86a4993bc73ed1f8f85d03b55d444a41bb426","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    if a driver is concerned, the state should be checked prior to calling this"},{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":488,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_74e23305","line":486,"updated":"2016-10-27 03:43:24.000000000","message":"target_state seems more suitable here. It\u0027s not a new state of a device, because it\u0027s not yet achieved when calling the function. \"target\" is more self explanatory","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7aa3b41a52d89bce63b923f84da3b14ed37b4b68","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    if a driver is concerned, the state should be checked prior to calling this"},{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":488,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_717233e7","line":486,"in_reply_to":"ba5da102_0a63921b","updated":"2016-10-27 15:23:57.000000000","message":"ok, cool :)","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    if a driver is concerned, the state should be checked prior to calling this"},{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":488,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_0a63921b","line":486,"in_reply_to":"ba5da102_74e23305","updated":"2016-10-27 07:19:56.000000000","message":"Please look at L.827","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":488,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":490,"context_line":"    :returns: one of ironic.common.states"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_eabbbe0c","line":487,"range":{"start_line":487,"start_character":19,"end_line":487,"end_character":44},"updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":548,"context_line":"    \"\"\"Turn the power ON for this node."},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":551,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":552,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":553,"context_line":"    :returns: one of ironic.common.states POWER_ON or ERROR."},{"line_number":554,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_2aee9622","line":551,"range":{"start_line":551,"start_character":20,"end_line":551,"end_character":45},"updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":561,"context_line":"    \"\"\"Turn the power OFF for this node."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":564,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":565,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":566,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":567,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_4af3ca0a","line":564,"range":{"start_line":564,"start_character":20,"end_line":564,"end_character":44},"updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":574,"context_line":"    \"\"\"Turn the power SOFT OFF for this node."},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":577,"context_line":"    :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":578,"context_line":"      ``None`` indicates to use default timeout."},{"line_number":579,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":580,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_8adde272","line":577,"range":{"start_line":577,"start_character":11,"end_line":577,"end_character":44},"updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"71f86a4993bc73ed1f8f85d03b55d444a41bb426","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_9420a74b","line":827,"updated":"2016-10-27 03:43:24.000000000","message":"target_state would be enough here; it could be easily overwritten in all elifs where needed.\nThis would simplify the code below and keep the params same as in the function above","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"7ad72d85637b566fbd4c9531b85e24330b2f7edd","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_afe29fd3","line":827,"in_reply_to":"ba5da102_31527b14","updated":"2016-10-28 01:28:19.000000000","message":"Joanna,\n\nThanks for the comment.\nWe can write the code as you presented.\nBut frankly speaking, it\u0027s not good practice.\n\nAs a good practice, we should use one variable per one purpose. Because if one variable used for multiple purposes, it make us debug difficult.\n\nIn your example code, the following code changes the purpose of the variable of \"new_sate\".\n\n new_state \u003d states.POWER_OFF\n\nAfter executing the above code, we lose the value of \"new_state\" which caller passed. Again, this makes us debug difficult.\n\nBest regards,\nNaohiro","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"7aa3b41a52d89bce63b923f84da3b14ed37b4b68","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_31527b14","line":827,"in_reply_to":"ba5da102_4add8a41","updated":"2016-10-27 15:23:57.000000000","message":"I agree with new variable name. However I don\u0027t see a need for distinguishing new_state and target_state. Here new_state is used only to find relevant action, and later on target_state is set.\nIt could be done as e.g.:\nelif new_state \u003d\u003d states.SOFT_POWER_OFF:\n            new_state \u003d states.POWER_OFF\n            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)\nelif ...","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_4add8a41","line":827,"in_reply_to":"ba5da102_9420a74b","updated":"2016-10-27 07:19:56.000000000","message":"set_power_state(self, task, new_state, timeout\u003dNone) is called from node_power_action(task, new_state, timeout\u003dNone) at [1].\n\n [1] https://review.openstack.org/#/c/216730/19/ironic/conductor/utils.py@71\n\nI aligned the parameter between the two functions to increase readability.\nAs the node_power_action() shows, new_state and target_state have to be managed distinctively.\nThe new state can be one of any power states, but target_state can be either states.POWER_OFF or states.POWER_ON.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"3e8e1bbb94df96cf0064dae5abd5814ddba165e4","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_fab0d38d","line":827,"in_reply_to":"ba5da102_af68dff6","updated":"2016-10-28 04:17:24.000000000","message":"Okay, thanks!","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"e02f2249de9a606d0c159ba784540763697adb9a","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_af68dff6","line":827,"in_reply_to":"ba5da102_afe29fd3","updated":"2016-10-28 01:54:03.000000000","message":"It\u0027s lost anyway at the end of the function. I also don\u0027t see any debug issues that it brings - before overwriting it can be checked. \n\nHowever - I think additional variable may make the code easier to understand. Leave it this way then :)","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"            one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"            or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":831,"context_line":"          ``None`` indicates to use default timeout."},{"line_number":832,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."},{"line_number":833,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_eae49e3c","line":830,"range":{"start_line":830,"start_character":15,"end_line":830,"end_character":48},"updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":23883,"name":"Joanna Taryma","email":"joanna.taryma@intel.com","username":"jtaryma"},"change_message_id":"71f86a4993bc73ed1f8f85d03b55d444a41bb426","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        \"\"\"Cycles the power to the task\u0027s node."},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":873,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":874,"context_line":"          ``None`` indicates to use default timeout."},{"line_number":875,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing."},{"line_number":876,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_d4769f3d","line":873,"updated":"2016-10-27 03:43:24.000000000","message":"same thing with default and lack of unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"bd0f0798aac678ad3f7886737f23baaa9a289655","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        \"\"\"Cycles the power to the task\u0027s node."},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":873,"context_line":"        :param timeout: timeout positive integer (\u003e 0) for any power state."},{"line_number":874,"context_line":"          ``None`` indicates to use default timeout."},{"line_number":875,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing."},{"line_number":876,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5da102_6acfaeb0","line":873,"in_reply_to":"ba5da102_d4769f3d","updated":"2016-10-27 07:19:56.000000000","message":"I\u0027ll add the unit.","commit_id":"c2cf27a3f77d1723801fa49b78525e1358b283da"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"1e05c89208dc7db3eda0c6e9cb6d01fbb7017615","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":831,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":832,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."},{"line_number":833,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_afa0cda0","line":830,"updated":"2016-10-28 16:12:14.000000000","message":"In the soft reboot case, I don\u0027t think this timeout will work as expected.\n\nThe operation can take up to timeout * 2 seconds since the timeout is measured once for soft power off and once for power on. I think the documentation (or code) should be updated to reflect this more clearly. Maybe explicitly mentioning that during reboot, the timeout applies to the intermediate power off and once again for the power on operation will help.","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"f19156aeb1cbd01a9704c4a97b8058b8ae0f8068","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":831,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":832,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."},{"line_number":833,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_f20185b0","line":830,"in_reply_to":"ba5da102_27977291","updated":"2016-11-01 15:18:29.000000000","message":"I was thinking more of a case like this, not the individual power off / power on phases taking timeout * 2 seconds:\n\ntimeout \u003d 10 seconds\n\nsoft power off takes 9 seconds, doesn\u0027t time out\npower on takes 9 seconds, doesn\u0027t time out\n\ntotal time \u003d 18 seconds, more than the specified timeout, but it won\u0027t raise an exception\n\nThe timeout won\u0027t persist across the intermediate power state because the mutable status object (L540) in this patch set is reinitialized on different calls to _set_and_wait. I don\u0027t really see how the power on phase checks for the time used up by the soft power off, please correct me if this isn\u0027t true.\n\nWhat if the doc was updated to say this, instead?\n\n\":param timeout: timeout (in seconds) positive integer (\u003e 0) for any power state. The timeout is counted once during power off and once during power on for reboots. ``None`` indicates that the default timeout will be used.\"","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"60649249e1e312ad3ad9b014f711923411d5eb44","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":831,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":832,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."},{"line_number":833,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_27977291","line":830,"in_reply_to":"ba5da102_afa0cda0","updated":"2016-10-31 02:34:30.000000000","message":"\u003e The operation can take up to timeout * 2 seconds\n\nIt\u0027s not true, because:\n1) if timeout happened in soft power OFF phase, it throws an exception after expiring timeout, so time is not timeout * 2 seconds.\n2) if timeout happened in power ON phase, it throws exception after expiring  \u0027soft power off time\u0027 + timeout, so time is not timeout * 2 seconds.  And \u0027soft power off time\u0027 can be nearly zero since there is a case that the bare metal is already in power off state when the reboot starts.","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"8c6485bf93655d4cbabe83329bd925bb5dffff80","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":831,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":832,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."},{"line_number":833,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_75eb8d13","line":830,"in_reply_to":"ba5da102_f20185b0","updated":"2016-11-02 02:47:36.000000000","message":"Mario,\n\nThanks for the advice.\n\n\u003e What if the doc was updated to say this, instead?\n\nLooks good, I\u0027ll update that.\n\nBest regards,\nNoahiro","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"1e05c89208dc7db3eda0c6e9cb6d01fbb7017615","unresolved":false,"context_lines":[{"line_number":846,"context_line":"        elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":847,"context_line":"            target_state \u003d states.POWER_OFF"},{"line_number":848,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":849,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":850,"context_line":"            intermediate_state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":851,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":852,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_cfc0a12d","line":849,"updated":"2016-10-28 16:12:14.000000000","message":"I\u0027m curious - what will happen if the caller specifies states.SOFT_REBOOT when the power is already off on the node? Does the caller check for this?","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"60649249e1e312ad3ad9b014f711923411d5eb44","unresolved":false,"context_lines":[{"line_number":846,"context_line":"        elif new_state \u003d\u003d states.SOFT_POWER_OFF:"},{"line_number":847,"context_line":"            target_state \u003d states.POWER_OFF"},{"line_number":848,"context_line":"            state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":849,"context_line":"        elif new_state \u003d\u003d states.SOFT_REBOOT:"},{"line_number":850,"context_line":"            intermediate_state \u003d _soft_power_off(driver_info, timeout\u003dtimeout)"},{"line_number":851,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":852,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_87e3de32","line":849,"in_reply_to":"ba5da102_cfc0a12d","updated":"2016-10-31 02:34:30.000000000","message":"No. Both hard reboot and soft reboot, more precisely all ipmi power controls, issue its ipmi power control command regardless of the current bare metal power state L.510 [1], see the comment at L.508 too.\n\n [1] https://review.openstack.org/#/c/216738/15/ironic/drivers/modules/ipmitool.py@510","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"1e05c89208dc7db3eda0c6e9cb6d01fbb7017615","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        \"\"\"Cycles the power to the task\u0027s node."},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":873,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":874,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":875,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing."},{"line_number":876,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_0fe1b9d0","line":873,"updated":"2016-10-28 16:12:14.000000000","message":"I think the documentation here should be updated similarly to L830.","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"60649249e1e312ad3ad9b014f711923411d5eb44","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        \"\"\"Cycles the power to the task\u0027s node."},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":873,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":874,"context_line":"          power state. ``None`` indicates to use default timeout."},{"line_number":875,"context_line":"        :raises: MissingParameterValue if required ipmi parameters are missing."},{"line_number":876,"context_line":"        :raises: InvalidParameterValue if an invalid power state was specified."}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_67bfaafb","line":873,"in_reply_to":"ba5da102_0fe1b9d0","updated":"2016-10-31 02:34:30.000000000","message":"please see my reply at L830.","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"4af0c9ca9d2bfe217a83c95313ff73c3c00d31f6","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":854,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":855,"context_line":"                raise exception.PowerStateFailure("},{"line_number":856,"context_line":"                    pstate\u003d(intermediate_target_state + \u0027 in the middle of \u0027 +"},{"line_number":857,"context_line":"                            new_state))"},{"line_number":858,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":859,"context_line":"            target_state \u003d states.POWER_ON"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_4255dbc3","line":856,"range":{"start_line":856,"start_character":56,"end_line":856,"end_character":76},"updated":"2017-01-06 11:27:37.000000000","message":"This string is not translated.","commit_id":"02e9ce97af1dbda29a1615edd365131a3202a6f1"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"7334e883f63143b84f513a1e030ee93632f39162","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":854,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":855,"context_line":"                raise exception.PowerStateFailure("},{"line_number":856,"context_line":"                    pstate\u003d(intermediate_target_state + \u0027 in the middle of \u0027 +"},{"line_number":857,"context_line":"                            new_state))"},{"line_number":858,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":859,"context_line":"            target_state \u003d states.POWER_ON"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_8c53186c","line":856,"range":{"start_line":856,"start_character":56,"end_line":856,"end_character":76},"in_reply_to":"ba5201f7_4255dbc3","updated":"2017-01-10 04:25:44.000000000","message":"I\u0027 fix that.","commit_id":"02e9ce97af1dbda29a1615edd365131a3202a6f1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"20404150141bb93e76367e693d6a156509747b27","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            intermediate_target_state \u003d states.POWER_OFF"},{"line_number":854,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":855,"context_line":"                raise exception.PowerStateFailure("},{"line_number":856,"context_line":"                    pstate\u003d(intermediate_target_state + \u0027 in the middle of \u0027 +"},{"line_number":857,"context_line":"                            new_state))"},{"line_number":858,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":859,"context_line":"            target_state \u003d states.POWER_ON"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_82505c60","line":856,"range":{"start_line":856,"start_character":56,"end_line":856,"end_character":76},"in_reply_to":"ba5201f7_4255dbc3","updated":"2017-01-09 15:38:43.000000000","message":"ops, good catch!","commit_id":"02e9ce97af1dbda29a1615edd365131a3202a6f1"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86cd7d1ec0b37f82694187373ee5f072da7c4014","unresolved":false,"context_lines":[{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":551,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":552,"context_line":"      power state. ``None`` indicates to use default timeout."},{"line_number":553,"context_line":"    :returns: one of ironic.common.states POWER_ON or ERROR."},{"line_number":554,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba5201f7_1dbff4aa","line":552,"updated":"2017-01-11 17:11:02.000000000","message":"nit: s/to use// or s/indicates//","commit_id":"3736f8a09a700dec77783637eca4885522318428"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86cd7d1ec0b37f82694187373ee5f072da7c4014","unresolved":false,"context_lines":[{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":564,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":565,"context_line":"      power state. ``None`` indicates to use default timeout."},{"line_number":566,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":567,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba5201f7_3dde7811","line":565,"updated":"2017-01-11 17:11:02.000000000","message":"ditto","commit_id":"3736f8a09a700dec77783637eca4885522318428"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86cd7d1ec0b37f82694187373ee5f072da7c4014","unresolved":false,"context_lines":[{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":577,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":578,"context_line":"      power state. ``None`` indicates to use default timeout."},{"line_number":579,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":580,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":581,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba5201f7_5de33cd9","line":578,"updated":"2017-01-11 17:11:02.000000000","message":"ditto","commit_id":"3736f8a09a700dec77783637eca4885522318428"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86cd7d1ec0b37f82694187373ee5f072da7c4014","unresolved":false,"context_lines":[{"line_number":889,"context_line":"        if intermediate_state !\u003d states.POWER_OFF:"},{"line_number":890,"context_line":"            raise exception.PowerStateFailure("},{"line_number":891,"context_line":"                pstate\u003d(states.POWER_OFF + \u0027 in the middle of \u0027 +"},{"line_number":892,"context_line":"                        states.REBOOT))"},{"line_number":893,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"},{"line_number":894,"context_line":"        state \u003d _power_on(driver_info, timeout\u003dtimeout)"},{"line_number":895,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba5201f7_7de480df","line":892,"updated":"2017-01-11 17:11:02.000000000","message":"if you want to change this, it should also be a translateable template, like you did for soft reboot","commit_id":"3736f8a09a700dec77783637eca4885522318428"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    if a driver is concerned, the state should be checked prior to calling this"},{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":488,"context_line":"      power state. ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_5823cc05","line":486,"range":{"start_line":486,"start_character":4,"end_line":486,"end_character":41},"updated":"2017-01-12 11:22:43.000000000","message":"Most nit: I don\u0027t think \"new_state\" is a good name here because for example: SOFT_POWER_OFF is not the desired power state, the desired power state is POWER_OFF.\n\nI think \"power_action\" would be a better name for this parameter, e.g:\n\n:param power_action: The action Ironic will perform when changing the power state of the node.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    if a driver is concerned, the state should be checked prior to calling this"},{"line_number":484,"context_line":"    method."},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    :param new_state: desired power state"},{"line_number":487,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":488,"context_line":"      power state. ``None`` indicates to use default timeout."},{"line_number":489,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_2b894ecb","line":486,"range":{"start_line":486,"start_character":4,"end_line":486,"end_character":41},"in_reply_to":"9a57fde8_5823cc05","updated":"2017-01-13 02:42:52.000000000","message":"Yeah, I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":548,"context_line":"    \"\"\"Turn the power ON for this node."},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":551,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":552,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":553,"context_line":"    :returns: one of ironic.common.states POWER_ON or ERROR."},{"line_number":554,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_b8175853","line":552,"range":{"start_line":551,"start_character":64,"end_line":552,"end_character":17},"updated":"2017-01-12 11:22:43.000000000","message":"This method is about POWER_ON only. Perhaps saying:\n\n:param timeout: The timeout in seconds ( \u003e 0 ) to wait for the power action to be completed. ``None`` indicates default timeout\"","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":548,"context_line":"    \"\"\"Turn the power ON for this node."},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":551,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":552,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":553,"context_line":"    :returns: one of ironic.common.states POWER_ON or ERROR."},{"line_number":554,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_ced45849","line":552,"range":{"start_line":551,"start_character":64,"end_line":552,"end_character":17},"in_reply_to":"9a57fde8_b8175853","updated":"2017-01-13 02:42:52.000000000","message":"I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":564,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":565,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":566,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":567,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_5b3746e3","line":565,"updated":"2017-01-12 11:22:43.000000000","message":"ditto","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":564,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":565,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":566,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":567,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_6e0364b9","line":565,"in_reply_to":"9a57fde8_5b3746e3","updated":"2017-01-13 02:42:52.000000000","message":"I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":577,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":578,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":579,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":580,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":581,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_9b31aeef","line":578,"updated":"2017-01-12 11:22:43.000000000","message":"ditto","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    :param driver_info: the ipmitool parameters for accessing a node."},{"line_number":577,"context_line":"    :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"},{"line_number":578,"context_line":"      power state. ``None`` indicates default timeout."},{"line_number":579,"context_line":"    :returns: one of ironic.common.states POWER_OFF or ERROR."},{"line_number":580,"context_line":"    :raises: IPMIFailure on an error from ipmitool (from _power_status call)."},{"line_number":581,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_aed2ac32","line":578,"in_reply_to":"9a57fde8_9b31aeef","updated":"2017-01-13 02:42:52.000000000","message":"I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_fb6d5acd","line":827,"updated":"2017-01-12 11:22:43.000000000","message":"s/new_state/power_state to match the base class and keep the same method signature.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        \"\"\"Turn the power on, off, soft reboot, or soft power off."},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        :param task: a TaskManager instance containing the node to act on."},{"line_number":827,"context_line":"        :param new_state: desired power state."},{"line_number":828,"context_line":"          one of ironic.common.states, POWER_ON, POWER_OFF, SOFT_POWER_OFF,"},{"line_number":829,"context_line":"          or SOFT_REBOOT."},{"line_number":830,"context_line":"        :param timeout: timeout (in seconds) positive integer (\u003e 0) for any"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_ee82f4c7","line":827,"in_reply_to":"9a57fde8_fb6d5acd","updated":"2017-01-13 02:42:52.000000000","message":"I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b8b2ab4a465e0a084157c112a4ec6b73e7967601","unresolved":false,"context_lines":[{"line_number":854,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":855,"context_line":"                raise exception.PowerStateFailure("},{"line_number":856,"context_line":"                    pstate\u003d(_("},{"line_number":857,"context_line":"                        \"%(intermediate)s in the middle of %(new_state)s\") %"},{"line_number":858,"context_line":"                        {\u0027intermediate\u0027: intermediate_target_state,"},{"line_number":859,"context_line":"                         \u0027new_state\u0027: new_state}))"},{"line_number":860,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a57fde8_7b208af8","line":857,"range":{"start_line":857,"start_character":42,"end_line":857,"end_character":58},"updated":"2017-01-12 11:22:43.000000000","message":"nit:\n\n\"in the middle of\" sounds a bit weird, e.g:\n\nThe full message would be: \"Failed to set node power state to \u0027power off\u0027 in the middle of \u0027soft power off\u0027\"\n\nI think \"while on\" would sounds better, e.g:\n\n\"Failed to set node power state to \u0027power off\u0027 while on \u0027soft power off\u0027\"\n\n(Tho I\u0027m not a native speaker, so take this with a grain of salt)","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"2f19f469a09194084e64a9488d7f99bc893d278c","unresolved":false,"context_lines":[{"line_number":854,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":855,"context_line":"                raise exception.PowerStateFailure("},{"line_number":856,"context_line":"                    pstate\u003d(_("},{"line_number":857,"context_line":"                        \"%(intermediate)s in the middle of %(new_state)s\") %"},{"line_number":858,"context_line":"                        {\u0027intermediate\u0027: intermediate_target_state,"},{"line_number":859,"context_line":"                         \u0027new_state\u0027: new_state}))"},{"line_number":860,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_8e7410fe","line":857,"range":{"start_line":857,"start_character":42,"end_line":857,"end_character":58},"in_reply_to":"9a57fde8_7b208af8","updated":"2017-01-13 02:42:52.000000000","message":"I\u0027ll fix that.","commit_id":"45ab7c5744c5eca4acc7068af019f3a1c9b2be3d"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"e046dfea0536ce8ca3f49090f56eb64c85093140","unresolved":false,"context_lines":[{"line_number":855,"context_line":"            if intermediate_state !\u003d intermediate_target_state:"},{"line_number":856,"context_line":"                raise exception.PowerStateFailure("},{"line_number":857,"context_line":"                    pstate\u003d(_("},{"line_number":858,"context_line":"                        \"%(intermediate)s while on %(power_state)s\") %"},{"line_number":859,"context_line":"                        {\u0027intermediate\u0027: intermediate_target_state,"},{"line_number":860,"context_line":"                         \u0027power_state\u0027: power_state}))"},{"line_number":861,"context_line":"            driver_utils.ensure_next_boot_device(task, driver_info)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_3504367d","line":858,"range":{"start_line":858,"start_character":47,"end_line":858,"end_character":67},"updated":"2017-01-13 14:05:59.000000000","message":"just while soft rebooting? :)","commit_id":"ed6c599083e9ddf8215c013dfe69947e86eeeaf0"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"e046dfea0536ce8ca3f49090f56eb64c85093140","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        if intermediate_state !\u003d states.POWER_OFF:"},{"line_number":891,"context_line":"            raise exception.PowerStateFailure("},{"line_number":892,"context_line":"                pstate\u003d(_("},{"line_number":893,"context_line":"                    \"%(power_off)s while on %(reboot)s\") %"},{"line_number":894,"context_line":"                    {\u0027power_off\u0027: states.POWER_OFF,"},{"line_number":895,"context_line":"                     \u0027reboot\u0027: states.REBOOT}))"},{"line_number":896,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_558d4230","line":893,"range":{"start_line":893,"start_character":21,"end_line":893,"end_character":54},"updated":"2017-01-13 14:05:59.000000000","message":"why do you substitute anything instead of just writing plain english here? :)","commit_id":"ed6c599083e9ddf8215c013dfe69947e86eeeaf0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"914e625224cc178781cd59a71c24638b317bd058","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        if intermediate_state !\u003d states.POWER_OFF:"},{"line_number":891,"context_line":"            raise exception.PowerStateFailure("},{"line_number":892,"context_line":"                pstate\u003d(_("},{"line_number":893,"context_line":"                    \"%(power_off)s while on %(reboot)s\") %"},{"line_number":894,"context_line":"                    {\u0027power_off\u0027: states.POWER_OFF,"},{"line_number":895,"context_line":"                     \u0027reboot\u0027: states.REBOOT}))"},{"line_number":896,"context_line":"        driver_utils.ensure_next_boot_device(task, driver_info)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_19dad378","line":893,"range":{"start_line":893,"start_character":21,"end_line":893,"end_character":54},"in_reply_to":"7a3c09a3_558d4230","updated":"2017-01-16 11:07:24.000000000","message":"heh true, POWER_OFF and REBOOT variables pointing to a static string, we don\u0027t even need to interpolate it.","commit_id":"ed6c599083e9ddf8215c013dfe69947e86eeeaf0"}],"ironic/tests/unit/drivers/modules/test_ipmitool.py":[{"author":{"_account_id":20522,"name":"Aline Bousquet","email":"albousque@gmail.com","username":"alineb"},"change_message_id":"3648640fbf145c3877eec65d4b30a85f53f51f2e","unresolved":false,"context_lines":[{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"        mock_off.assert_called_once_with(self.info, timeout\u003dNone)"},{"line_number":1381,"context_line":"        mock_on.assert_called_once_with(self.info, timeout\u003dNone)"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @mock.patch.object(ipmi, \u0027_power_on\u0027, autospec\u003dTrue)"},{"line_number":1384,"context_line":"    @mock.patch.object(ipmi, \u0027_power_off\u0027, autospec\u003dTrue)"},{"line_number":1385,"context_line":"    def test_set_power_on_fail(self, mock_off, mock_on):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_03ec5d8e","line":1382,"updated":"2016-08-02 15:02:45.000000000","message":"Could you add some tests on what happens if soft_power_off and soft_reboot fail, and on how the timeout behaves?","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"621fc666b418d5628d71975e69bf2ce25d43b3d3","unresolved":false,"context_lines":[{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"        mock_off.assert_called_once_with(self.info, timeout\u003dNone)"},{"line_number":1381,"context_line":"        mock_on.assert_called_once_with(self.info, timeout\u003dNone)"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":"    @mock.patch.object(ipmi, \u0027_power_on\u0027, autospec\u003dTrue)"},{"line_number":1384,"context_line":"    @mock.patch.object(ipmi, \u0027_power_off\u0027, autospec\u003dTrue)"},{"line_number":1385,"context_line":"    def test_set_power_on_fail(self, mock_off, mock_on):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d8964793","line":1382,"in_reply_to":"bacf61ea_03ec5d8e","updated":"2016-08-04 09:42:08.000000000","message":"I\u0027ll add those.","commit_id":"1fe4445ae86193d35093af0d0a90f74feb224165"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"1e05c89208dc7db3eda0c6e9cb6d01fbb7017615","unresolved":false,"context_lines":[{"line_number":1257,"context_line":"        state \u003d ipmi._power_on(self.info)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        self.assertEqual(mock_exec.call_args_list, expected)"},{"line_number":1260,"context_line":"        self.assertEqual(states.ERROR, state)"},{"line_number":1261,"context_line":""},{"line_number":1262,"context_line":"    @mock.patch.object(ipmi, \u0027_exec_ipmitool\u0027, autospec\u003dTrue)"},{"line_number":1263,"context_line":"    @mock.patch(\u0027eventlet.greenthread.sleep\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_ef04857f","line":1260,"updated":"2016-10-28 16:12:14.000000000","message":"Can a test be added for what happens when you soft reboot on a node that\u0027s already powered off? If this case is already checked by the caller, don\u0027t worry about it though.","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"410f7a106d7bddd2c8edf1d33d7ec186d32551a7","unresolved":false,"context_lines":[{"line_number":1257,"context_line":"        state \u003d ipmi._power_on(self.info)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        self.assertEqual(mock_exec.call_args_list, expected)"},{"line_number":1260,"context_line":"        self.assertEqual(states.ERROR, state)"},{"line_number":1261,"context_line":""},{"line_number":1262,"context_line":"    @mock.patch.object(ipmi, \u0027_exec_ipmitool\u0027, autospec\u003dTrue)"},{"line_number":1263,"context_line":"    @mock.patch(\u0027eventlet.greenthread.sleep\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_c734f6fc","line":1260,"in_reply_to":"ba5da102_6777aa3a","updated":"2016-10-31 02:58:51.000000000","message":"Mario,\n\nI\u0027ll add a normal test case of _soft_power_off().\n\nBest regards,\nNaohiro","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"f19156aeb1cbd01a9704c4a97b8058b8ae0f8068","unresolved":false,"context_lines":[{"line_number":1257,"context_line":"        state \u003d ipmi._power_on(self.info)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        self.assertEqual(mock_exec.call_args_list, expected)"},{"line_number":1260,"context_line":"        self.assertEqual(states.ERROR, state)"},{"line_number":1261,"context_line":""},{"line_number":1262,"context_line":"    @mock.patch.object(ipmi, \u0027_exec_ipmitool\u0027, autospec\u003dTrue)"},{"line_number":1263,"context_line":"    @mock.patch(\u0027eventlet.greenthread.sleep\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_927129ab","line":1260,"in_reply_to":"ba5da102_c734f6fc","updated":"2016-11-01 15:18:29.000000000","message":"Thanks, looks good","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"},{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"60649249e1e312ad3ad9b014f711923411d5eb44","unresolved":false,"context_lines":[{"line_number":1257,"context_line":"        state \u003d ipmi._power_on(self.info)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        self.assertEqual(mock_exec.call_args_list, expected)"},{"line_number":1260,"context_line":"        self.assertEqual(states.ERROR, state)"},{"line_number":1261,"context_line":""},{"line_number":1262,"context_line":"    @mock.patch.object(ipmi, \u0027_exec_ipmitool\u0027, autospec\u003dTrue)"},{"line_number":1263,"context_line":"    @mock.patch(\u0027eventlet.greenthread.sleep\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5da102_6777aa3a","line":1260,"in_reply_to":"ba5da102_ef04857f","updated":"2016-10-31 02:34:30.000000000","message":"As I answered in [1], power off and soft power off always issue ipmi \"power off\" and \"power soft\" command respectively.\n\ntest__power_on_max_retries() at L.1243 and test__soft_power_off_max_retries() at L.1264 have covered the condition.\n\n [1] https://review.openstack.org/#/c/216738/15/ironic/drivers/modules/ipmitool.py@849","commit_id":"5c5076f26bb243fbb6fe00c5a1ba0a0f9e171e8c"}],"releasenotes/notes/ipmitool-soft-power-d5599dcb69eb0f5e.yaml":[{"author":{"_account_id":13719,"name":"Naohiro Tamura","email":"naohirot.openstack@gmail.com","username":"nao"},"change_message_id":"8e47bdf44d2f0149637b089a39ae9d6f9aa7a908","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Adds support for ``soft reboot`` and ``soft power off`` to"},{"line_number":4,"context_line":"    ipmitool power driver. "}],"source_content_type":"text/x-yaml","patch_set":27,"id":"ba5201f7_62fd1b6e","line":4,"range":{"start_line":4,"start_character":26,"end_line":4,"end_character":27},"updated":"2017-01-10 06:15:20.000000000","message":"oops","commit_id":"c33bd28ed9e7bc677b3a212337af312e876240e7"}]}
