)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3b800eb21207640a936c3c1d2b787b838b67353b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In order to make getting clean steps a synchronous call, instead of"},{"line_number":10,"context_line":"one that blocks on communication with the agent, the agent clean steps"},{"line_number":11,"context_line":"are cached in the node\u0027s driver_internal_info. Any time cleaning is"},{"line_number":12,"context_line":"started, the steps will be fetched from the agent and cached."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I26288802d06683fd99138bfea488233c88260a7f"},{"line_number":15,"context_line":"Partial-Bug: #1526290"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da6ed579_310878d9","line":12,"updated":"2016-01-18 12:00:11.000000000","message":"Hi Ruby,\n\nSorry i think I\u0027m missing the context/point of the patch. Why do we cache clean steps if every time cleaning is started we are going to fetch it again? Do we intent to have an API call that will call this get_clean_steps() methods?\n\nBecause if that method is only called as part of cleaning and the steps are fetched every time cleaning starts I don\u0027t see much the point in caching it, unless we are attempting to reduce the number of iterations between Ironic and the IPA ramdisk ?","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfcef1781dad8acb652b9a994d64493fc01edc50","unresolved":false,"context_lines":[{"line_number":9,"context_line":"In order to make getting clean steps a synchronous call, instead of"},{"line_number":10,"context_line":"one that blocks on communication with the agent, the agent clean steps"},{"line_number":11,"context_line":"are cached in the node\u0027s driver_internal_info. Any time cleaning is"},{"line_number":12,"context_line":"started, the steps will be fetched from the agent and cached."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I26288802d06683fd99138bfea488233c88260a7f"},{"line_number":15,"context_line":"Partial-Bug: #1526290"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba63e191_e8beb3d3","line":12,"in_reply_to":"da6ed579_310878d9","updated":"2016-01-18 18:54:43.000000000","message":"I will update it to mention that it is needed for GET /nodes/\u003cnode_ident\u003e/cleaning/steps (http://specs.openstack.org/openstack/ironic-specs/specs/approved/manual-cleaning.html#get-nodes-node-ident-cleaning-steps)","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"4c4b2a5edb1f3711944b718c6fc4648081b5f438","unresolved":false,"context_lines":[{"line_number":12,"context_line":"started, the steps will be fetched from the agent and cached."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I26288802d06683fd99138bfea488233c88260a7f"},{"line_number":15,"context_line":"Partial-Bug: #1526290"},{"line_number":16,"context_line":"Co-Authored-By: Josh Gachnang \u003cjosh@pcsforeducation.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da6ed579_15f8c57b","line":15,"updated":"2016-01-18 10:34:04.000000000","message":"This works for both of automated and manual clean, right? because this belong to #1526290","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfcef1781dad8acb652b9a994d64493fc01edc50","unresolved":false,"context_lines":[{"line_number":12,"context_line":"started, the steps will be fetched from the agent and cached."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I26288802d06683fd99138bfea488233c88260a7f"},{"line_number":15,"context_line":"Partial-Bug: #1526290"},{"line_number":16,"context_line":"Co-Authored-By: Josh Gachnang \u003cjosh@pcsforeducation.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba63e191_88aff77c","line":15,"in_reply_to":"da6ed579_15f8c57b","updated":"2016-01-18 18:54:43.000000000","message":"Right, it caches all available clean steps. It is part of this RFE, although it should have already existed with the automated cleaning but never got approved. And even if it had been approved, I modified the API to accommodate manual cleaning too.","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"}],"ironic/drivers/base.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"e74f7adfa34bfae2617e5ace304fb9029a3823a1","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        :param task: A TaskManager object, useful for interfaces overriding"},{"line_number":184,"context_line":"            this function"},{"line_number":185,"context_line":"        :raises NodeCleaningFailure: if there is a problem getting the steps"},{"line_number":186,"context_line":"            from the driver. For example, when a node (using an agent driver)"},{"line_number":187,"context_line":"            has just been enrolled and the agent isn\u0027t alive yet to be queried"},{"line_number":188,"context_line":"            for the available clean steps."},{"line_number":189,"context_line":"        :returns: A list of clean step dictionaries"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a57f1b5_8f21e4b6","line":186,"updated":"2016-02-11 07:18:16.000000000","message":"This example is an implementation detail, is it really needed in base?","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"b4bb807469a8fd05dc3af34a5e47eb217a27c91e","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        :param task: A TaskManager object, useful for interfaces overriding"},{"line_number":184,"context_line":"            this function"},{"line_number":185,"context_line":"        :raises NodeCleaningFailure: if there is a problem getting the steps"},{"line_number":186,"context_line":"            from the driver. For example, when a node (using an agent driver)"},{"line_number":187,"context_line":"            has just been enrolled and the agent isn\u0027t alive yet to be queried"},{"line_number":188,"context_line":"            for the available clean steps."},{"line_number":189,"context_line":"        :returns: A list of clean step dictionaries"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_6f3e2b29","line":186,"in_reply_to":"3a57f1b5_8f21e4b6","updated":"2016-02-17 19:34:17.000000000","message":"That\u0027s a good question. I doubt that it is needed, but I think it is fine to have it. I got this code originally from Josh, so I am guessing I left it in (or I copy/pasted from elsewhere). We could remove it if people want.","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"}],"ironic/drivers/modules/agent_base_vendor.py":[{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"4c4b2a5edb1f3711944b718c6fc4648081b5f438","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        Gets the node\u0027s clean steps from the booted agent and caches them."},{"line_number":223,"context_line":"        The steps are cached to make get_clean_steps() calls synchronous, and"},{"line_number":224,"context_line":"        should be refreshed as soon as the agent boots to start cleaning or"},{"line_number":225,"context_line":"        if cleaning is restarted because of a cleaning version mismatch."},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        :param task: a TaskManager instance"},{"line_number":228,"context_line":"        :raises: NodeCleaningFailure if the agent returns invalid results"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_d54a2d55","line":225,"updated":"2016-01-18 10:34:04.000000000","message":"Is it possible do a series of steps without restart? We have to restart agent and cache the cleans steps after every step?","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfcef1781dad8acb652b9a994d64493fc01edc50","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        Gets the node\u0027s clean steps from the booted agent and caches them."},{"line_number":223,"context_line":"        The steps are cached to make get_clean_steps() calls synchronous, and"},{"line_number":224,"context_line":"        should be refreshed as soon as the agent boots to start cleaning or"},{"line_number":225,"context_line":"        if cleaning is restarted because of a cleaning version mismatch."},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        :param task: a TaskManager instance"},{"line_number":228,"context_line":"        :raises: NodeCleaningFailure if the agent returns invalid results"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_483fbf25","line":225,"in_reply_to":"da6ed579_d54a2d55","updated":"2016-01-18 18:54:43.000000000","message":"I don\u0027t know what you mean by \u0027do a series of steps without restart\u0027.\n\nNo, we don\u0027t cache the steps after every clean step is done. Where do you see that happening?","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"46adf6ca190f000df7bad8283cb94ccea43f5dcc","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        agent_result \u003d self._client.get_clean_steps(node, task.ports).get("},{"line_number":238,"context_line":"            \u0027command_result\u0027)"},{"line_number":239,"context_line":"        missing \u003d [key for key in [\u0027clean_steps\u0027, \u0027hardware_manager_version\u0027]"},{"line_number":240,"context_line":"                   if key not in agent_result]"},{"line_number":241,"context_line":"        if missing:"},{"line_number":242,"context_line":"            raise exception.NodeCleaningFailure(_("},{"line_number":243,"context_line":"                \u0027agent get_clean_steps for node %(node)s returned an invalid \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba63e191_e5e81119","line":240,"updated":"2016-01-19 15:22:58.000000000","message":"it\u0027s a nit but to make it more pythonic (simpler, without conditionals and list comprehensions) you can use the set() built-in type to find the missing values, e.g\n\nmissing \u003d set([\u0027clean_steps\u0027, \u0027hardware_manager_version\u0027]).difference(agent_result)\n\n[0] https://docs.python.org/2/library/stdtypes.html#set.difference","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfe021aca6043b215c59b5a733c919e63cbbd84e","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        agent_result \u003d self._client.get_clean_steps(node, task.ports).get("},{"line_number":238,"context_line":"            \u0027command_result\u0027)"},{"line_number":239,"context_line":"        missing \u003d [key for key in [\u0027clean_steps\u0027, \u0027hardware_manager_version\u0027]"},{"line_number":240,"context_line":"                   if key not in agent_result]"},{"line_number":241,"context_line":"        if missing:"},{"line_number":242,"context_line":"            raise exception.NodeCleaningFailure(_("},{"line_number":243,"context_line":"                \u0027agent get_clean_steps for node %(node)s returned an invalid \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_3cf39b75","line":240,"in_reply_to":"ba63e191_e5e81119","updated":"2016-01-20 16:33:32.000000000","message":"Good idea. Thx.","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"46adf6ca190f000df7bad8283cb94ccea43f5dcc","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        for step_list in agent_result[\u0027clean_steps\u0027].values():"},{"line_number":252,"context_line":"            for step in step_list:"},{"line_number":253,"context_line":"                missing \u003d [key for key in [\u0027interface\u0027, \u0027step\u0027, \u0027priority\u0027]"},{"line_number":254,"context_line":"                           if key not in step]"},{"line_number":255,"context_line":"                if missing:"},{"line_number":256,"context_line":"                    raise exception.NodeCleaningFailure(_("},{"line_number":257,"context_line":"                        \u0027agent get_clean_steps for node %(node)s returned an \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba63e191_85103550","line":254,"updated":"2016-01-19 15:22:58.000000000","message":"ditto:\n\nmissing \u003d set([\u0027interface\u0027, \u0027step\u0027, \u0027priority\u0027]).difference(step)","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfe021aca6043b215c59b5a733c919e63cbbd84e","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        for step_list in agent_result[\u0027clean_steps\u0027].values():"},{"line_number":252,"context_line":"            for step in step_list:"},{"line_number":253,"context_line":"                missing \u003d [key for key in [\u0027interface\u0027, \u0027step\u0027, \u0027priority\u0027]"},{"line_number":254,"context_line":"                           if key not in step]"},{"line_number":255,"context_line":"                if missing:"},{"line_number":256,"context_line":"                    raise exception.NodeCleaningFailure(_("},{"line_number":257,"context_line":"                        \u0027agent get_clean_steps for node %(node)s returned an \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_9c02c73d","line":254,"in_reply_to":"ba63e191_85103550","updated":"2016-01-20 16:33:32.000000000","message":"+1","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"e74f7adfa34bfae2617e5ace304fb9029a3823a1","unresolved":false,"context_lines":[{"line_number":314,"context_line":"                         \u0027%(node)s: %(err)s.\u0027) %"},{"line_number":315,"context_line":"                       {\u0027node\u0027: node.uuid, \u0027err\u0027: e})"},{"line_number":316,"context_line":"                LOG.exception(msg)"},{"line_number":317,"context_line":"                return manager_utils.cleaning_error_handler(task, msg)"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"            if manual_clean:"},{"line_number":320,"context_line":"                # Don\u0027t restart manual cleaning if agent reboots to a new"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a57f1b5_0a8c0234","line":317,"updated":"2016-02-11 07:18:16.000000000","message":"Looks like invalid clean step info causes impossibility of restart auto cleaning if version mismatch (from l333). It\u0027s correct?","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"0b8b39678b0371bbd6e2b265858576753d272324","unresolved":false,"context_lines":[{"line_number":314,"context_line":"                         \u0027%(node)s: %(err)s.\u0027) %"},{"line_number":315,"context_line":"                       {\u0027node\u0027: node.uuid, \u0027err\u0027: e})"},{"line_number":316,"context_line":"                LOG.exception(msg)"},{"line_number":317,"context_line":"                return manager_utils.cleaning_error_handler(task, msg)"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"            if manual_clean:"},{"line_number":320,"context_line":"                # Don\u0027t restart manual cleaning if agent reboots to a new"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_041ccbbf","line":317,"in_reply_to":"3a57f1b5_0a8c0234","updated":"2016-02-17 09:25:03.000000000","message":"I think this is reasonable because the invalid clean step is directly from agent, so that means there is a more serious problem compare to VERSION_MISMATCH and should set the node to clean failed state.","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"77b5c2dc494e276704f66588051521365ae3fbf1","unresolved":false,"context_lines":[{"line_number":314,"context_line":"                         \u0027%(node)s: %(err)s.\u0027) %"},{"line_number":315,"context_line":"                       {\u0027node\u0027: node.uuid, \u0027err\u0027: e})"},{"line_number":316,"context_line":"                LOG.exception(msg)"},{"line_number":317,"context_line":"                return manager_utils.cleaning_error_handler(task, msg)"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"            if manual_clean:"},{"line_number":320,"context_line":"                # Don\u0027t restart manual cleaning if agent reboots to a new"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_845d5649","line":317,"in_reply_to":"dae33548_041ccbbf","updated":"2016-02-17 19:20:27.000000000","message":"+1 to what Tan said, assuming I\u0027m interpreting this correctly.","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"b4bb807469a8fd05dc3af34a5e47eb217a27c91e","unresolved":false,"context_lines":[{"line_number":314,"context_line":"                         \u0027%(node)s: %(err)s.\u0027) %"},{"line_number":315,"context_line":"                       {\u0027node\u0027: node.uuid, \u0027err\u0027: e})"},{"line_number":316,"context_line":"                LOG.exception(msg)"},{"line_number":317,"context_line":"                return manager_utils.cleaning_error_handler(task, msg)"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"            if manual_clean:"},{"line_number":320,"context_line":"                # Don\u0027t restart manual cleaning if agent reboots to a new"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_0f8aff1a","line":317,"in_reply_to":"dae33548_845d5649","updated":"2016-02-17 19:34:17.000000000","message":"Yes, that\u0027s correct Yuriy. Do you think a comment would be helpful?","commit_id":"74f66614042f8b32cadf7d6f171907c6ed1cefcb"}],"ironic/drivers/modules/deploy_utils.py":[{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"4c4b2a5edb1f3711944b718c6fc4648081b5f438","unresolved":false,"context_lines":[{"line_number":569,"context_line":"    \"\"\""},{"line_number":570,"context_line":"    node \u003d task.node"},{"line_number":571,"context_line":"    try:"},{"line_number":572,"context_line":"        all \u003d node.driver_internal_info[\u0027agent_cached_clean_steps\u0027]"},{"line_number":573,"context_line":"    except KeyError:"},{"line_number":574,"context_line":"        raise exception.NodeCleaningFailure(_(\u0027Cleaning steps are not yet \u0027"},{"line_number":575,"context_line":"                                              \u0027available for node %(node)s\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_9f7854fa","line":572,"updated":"2016-01-18 10:34:04.000000000","message":"change \u0027all\u0027 to a more readable name, all_clean_steps?","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3b800eb21207640a936c3c1d2b787b838b67353b","unresolved":false,"context_lines":[{"line_number":569,"context_line":"    \"\"\""},{"line_number":570,"context_line":"    node \u003d task.node"},{"line_number":571,"context_line":"    try:"},{"line_number":572,"context_line":"        all \u003d node.driver_internal_info[\u0027agent_cached_clean_steps\u0027]"},{"line_number":573,"context_line":"    except KeyError:"},{"line_number":574,"context_line":"        raise exception.NodeCleaningFailure(_(\u0027Cleaning steps are not yet \u0027"},{"line_number":575,"context_line":"                                              \u0027available for node %(node)s\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_d181dcfc","line":572,"in_reply_to":"da6ed579_9f7854fa","updated":"2016-01-18 12:00:11.000000000","message":"all is a reserved keyword in python as well, we should avoid overwriting it.\n\nIn [3]: all([True, True, True])\nOut[3]: True\n\nIn [4]: all([True, True, False])\nOut[4]: False","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfcef1781dad8acb652b9a994d64493fc01edc50","unresolved":false,"context_lines":[{"line_number":569,"context_line":"    \"\"\""},{"line_number":570,"context_line":"    node \u003d task.node"},{"line_number":571,"context_line":"    try:"},{"line_number":572,"context_line":"        all \u003d node.driver_internal_info[\u0027agent_cached_clean_steps\u0027]"},{"line_number":573,"context_line":"    except KeyError:"},{"line_number":574,"context_line":"        raise exception.NodeCleaningFailure(_(\u0027Cleaning steps are not yet \u0027"},{"line_number":575,"context_line":"                                              \u0027available for node %(node)s\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_68516362","line":572,"in_reply_to":"da6ed579_d181dcfc","updated":"2016-01-18 18:54:43.000000000","message":"Oh, didn\u0027t realize that all is a reserved keyword!","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"4c4b2a5edb1f3711944b718c6fc4648081b5f438","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    except KeyError:"},{"line_number":574,"context_line":"        raise exception.NodeCleaningFailure(_(\u0027Cleaning steps are not yet \u0027"},{"line_number":575,"context_line":"                                              \u0027available for node %(node)s\u0027)"},{"line_number":576,"context_line":"                                            % ({\u0027node\u0027: node.uuid}))"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"    if interface:"},{"line_number":579,"context_line":"        steps \u003d [step.copy() for step in all.get(interface, [])]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_7f024071","line":576,"updated":"2016-01-18 10:34:04.000000000","message":"nit: % ({})) , the parentheses is not necessary","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfcef1781dad8acb652b9a994d64493fc01edc50","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    except KeyError:"},{"line_number":574,"context_line":"        raise exception.NodeCleaningFailure(_(\u0027Cleaning steps are not yet \u0027"},{"line_number":575,"context_line":"                                              \u0027available for node %(node)s\u0027)"},{"line_number":576,"context_line":"                                            % ({\u0027node\u0027: node.uuid}))"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":"    if interface:"},{"line_number":579,"context_line":"        steps \u003d [step.copy() for step in all.get(interface, [])]"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_a26c5209","line":576,"in_reply_to":"da6ed579_7f024071","updated":"2016-01-18 18:54:43.000000000","message":"Done","commit_id":"637e7a7025b18135915e3ca8e574b80ce52d7218"}],"ironic/tests/unit/drivers/modules/test_agent_base_vendor.py":[{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"933f0ab136c97f5be0846796d2a4e182c032198e","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        for state in (states.CLEANWAIT, states.CLEANING):"},{"line_number":405,"context_line":"            self.node.provision_state \u003d state"},{"line_number":406,"context_line":"            self.node.save()"},{"line_number":407,"context_line":"            for i in range(len(mocks)):"},{"line_number":408,"context_line":"                failed_mock \u003d mocks[i]"},{"line_number":409,"context_line":"                failed_mock.side_effect \u003d Exception()"},{"line_number":410,"context_line":"                with task_manager.acquire("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_bc80f547","line":407,"updated":"2016-01-20 13:58:57.000000000","message":"It\u0027s more Pythonic to use `for i, failed_mock in enumerate(mocks)`.\n\nThe point of this test is \"all steps up to the failing step are called, and no step after it is called\", right? That took me a while to work out - it would be good to add a comment to that effect. Or perhaps you could make the intent clearer as follows:\n\nfor i in range(len(mocks)):\n    before, failing_step, after \u003d mocks[:i], mocks[i], mocks[i+1:]\n    failing_step.side_effect \u003d Exception()\n    # assertions go here","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfe021aca6043b215c59b5a733c919e63cbbd84e","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        for state in (states.CLEANWAIT, states.CLEANING):"},{"line_number":405,"context_line":"            self.node.provision_state \u003d state"},{"line_number":406,"context_line":"            self.node.save()"},{"line_number":407,"context_line":"            for i in range(len(mocks)):"},{"line_number":408,"context_line":"                failed_mock \u003d mocks[i]"},{"line_number":409,"context_line":"                failed_mock.side_effect \u003d Exception()"},{"line_number":410,"context_line":"                with task_manager.acquire("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_7c46f3c0","line":407,"in_reply_to":"9a68dd71_bc80f547","updated":"2016-01-20 16:33:32.000000000","message":"Good idea. But will not put in any comments to see if it is understandable w/o ;)","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"933f0ab136c97f5be0846796d2a4e182c032198e","unresolved":false,"context_lines":[{"line_number":421,"context_line":"                # Reset mocks for the next interaction"},{"line_number":422,"context_line":"                mock_touch.reset_mock()"},{"line_number":423,"context_line":"                mock_handler.reset_mock()"},{"line_number":424,"context_line":"                for m in range(len(mocks)):"},{"line_number":425,"context_line":"                    mocks[m].reset_mock()"},{"line_number":426,"context_line":"                failed_mock.side_effect \u003d None"},{"line_number":427,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_eaf2276f","line":424,"updated":"2016-01-20 13:58:57.000000000","message":"`for m in mocks` would be more idiomatic and slightly clearer here. You could save a couple of lines by iterating over `mocks + [mock_touch, mock_handler]`.","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bfe021aca6043b215c59b5a733c919e63cbbd84e","unresolved":false,"context_lines":[{"line_number":421,"context_line":"                # Reset mocks for the next interaction"},{"line_number":422,"context_line":"                mock_touch.reset_mock()"},{"line_number":423,"context_line":"                mock_handler.reset_mock()"},{"line_number":424,"context_line":"                for m in range(len(mocks)):"},{"line_number":425,"context_line":"                    mocks[m].reset_mock()"},{"line_number":426,"context_line":"                failed_mock.side_effect \u003d None"},{"line_number":427,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_3c94fb35","line":424,"in_reply_to":"9a68dd71_eaf2276f","updated":"2016-01-20 16:33:32.000000000","message":"+1","commit_id":"ca95f38231a0ea632ecd7ee2daf512df6334cb7b"}]}
