)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"57ad8e991fbdfc6159cd105bea574c24eecb92a8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Enable async callbacks from task.process_event()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add optional parametes to task.process_event such that it can register"},{"line_number":10,"context_line":"async callbacks. This simplifies the some of the code in"},{"line_number":11,"context_line":"ConductorManager."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3a961159_f9b3a097","line":9,"updated":"2014-12-19 03:26:07.000000000","message":"done","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"1fefb0afcd00501da3f7f8d980f056b549519e87","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Enable async callbacks from task.process_event()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add optional parametes to task.process_event such that it can register"},{"line_number":10,"context_line":"async callbacks. This simplifies the some of the code in"},{"line_number":11,"context_line":"ConductorManager."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3a961159_7fac578d","line":9,"updated":"2014-12-16 16:40:14.000000000","message":"nit: parameters","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"5b69ff80a674910adc377e6622e4472f310ec2ac","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Enable async callbacks from task.process_event()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add optional parameters to task.process_event such that it can register"},{"line_number":10,"context_line":"async callbacks. This simplifies the some of the code in"},{"line_number":11,"context_line":"ConductorManager."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Update do_node_deploy and do_node_teardown to use this approach."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3a961159_af234a03","line":10,"updated":"2014-12-22 22:28:06.000000000","message":"nit: \u0027the some\u0027 -\u003e \u0027some\u0027","commit_id":"bac5720330a8fac87766637767685260077563a2"}],"ironic/conductor/task_manager.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"77b0b6f4a8a74476b30136b693d2da29e8dd43d7","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"},{"line_number":266,"context_line":"        :param call_kwargs: optional **kwargs to pass to to the callback method"},{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        \"\"\""},{"line_number":270,"context_line":"        # advance the state machine into -ING state"},{"line_number":271,"context_line":"        # this may raise InvalidState, but does not change node states directly"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_00537ae2","line":268,"updated":"2014-12-11 16:00:24.000000000","message":"I\u0027m feeling a bit uneasy about this parameter looking like smth local to this call, while actually it\u0027s a short-cut for calling set_spawn_error_hook on a task. Maybe it\u0027s better to do explicitly?","commit_id":"083618cd75532ba1e9725a87e1c02860a59d174f"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"57ad8e991fbdfc6159cd105bea574c24eecb92a8","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    def process_event(self, event, callback\u003dNone, call_args\u003dNone,"},{"line_number":260,"context_line":"                      call_kwargs\u003dNone, err_handler\u003dNone):"},{"line_number":261,"context_line":"        \"\"\"Process an event by advancing the state machine."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        :param event: the name of the event to process"},{"line_number":264,"context_line":"        :param callback: optional callback to invoke upon event transition"},{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_19b94c79","line":262,"updated":"2014-12-19 03:26:07.000000000","message":"indeed :)","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"13612ceb6b95beffa1d09f66a67f84b0d1a32a0a","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    def process_event(self, event, callback\u003dNone, call_args\u003dNone,"},{"line_number":260,"context_line":"                      call_kwargs\u003dNone, err_handler\u003dNone):"},{"line_number":261,"context_line":"        \"\"\"Process an event by advancing the state machine."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        :param event: the name of the event to process"},{"line_number":264,"context_line":"        :param callback: optional callback to invoke upon event transition"},{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_21670dec","line":262,"updated":"2014-12-16 20:54:24.000000000","message":"it is doing more than advancing the state machine now. It may actually do an action!","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7e3b2309aececc206dc0d86e227ff553dba05c01","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"},{"line_number":266,"context_line":"        :param call_kwargs: optional **kwargs to pass to to the callback method"},{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        \"\"\""},{"line_number":270,"context_line":"        # advance the state machine into -ING state"},{"line_number":271,"context_line":"        # this may raise InvalidState, but does not change node states directly"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_2552b613","line":268,"updated":"2014-12-17 18:12:13.000000000","message":"add :raises InvalidState...","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"57ad8e991fbdfc6159cd105bea574c24eecb92a8","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"},{"line_number":266,"context_line":"        :param call_kwargs: optional **kwargs to pass to to the callback method"},{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        \"\"\""},{"line_number":270,"context_line":"        # advance the state machine into -ING state"},{"line_number":271,"context_line":"        # this may raise InvalidState, but does not change node states directly"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_39b1a88f","line":268,"updated":"2014-12-19 03:26:07.000000000","message":"done","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7e3b2309aececc206dc0d86e227ff553dba05c01","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        \"\"\""},{"line_number":270,"context_line":"        # advance the state machine into -ING state"},{"line_number":271,"context_line":"        # this may raise InvalidState, but does not change node states directly"},{"line_number":272,"context_line":"        self.fsm.process_event(event)"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_8539aada","line":270,"updated":"2014-12-17 18:12:13.000000000","message":"I\u0027m not sure this is true. The event can be used in a transition, and if I look in states.py, I see transitions that aren\u0027t all -ING states (assuming you mean the \u0027end\u0027 parameter in fsm.add_transition().","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"57ad8e991fbdfc6159cd105bea574c24eecb92a8","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        \"\"\""},{"line_number":270,"context_line":"        # advance the state machine into -ING state"},{"line_number":271,"context_line":"        # this may raise InvalidState, but does not change node states directly"},{"line_number":272,"context_line":"        self.fsm.process_event(event)"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_59ae742f","line":270,"updated":"2014-12-19 03:26:07.000000000","message":"done","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"1fefb0afcd00501da3f7f8d980f056b549519e87","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        if err_handler:"},{"line_number":277,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":278,"context_line":"                                      self.node.provision_state,"},{"line_number":279,"context_line":"                                      self.node.target_provision_state)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        # set up the async worker"},{"line_number":282,"context_line":"        if callback:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_2a2b6f31","line":279,"updated":"2014-12-16 16:40:14.000000000","message":"The old code sets the saved provision_state and target_provision_state *before* the call to process_event() above. Shouldn\u0027t we move this err_handler code above it?","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"13612ceb6b95beffa1d09f66a67f84b0d1a32a0a","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        if err_handler:"},{"line_number":277,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":278,"context_line":"                                      self.node.provision_state,"},{"line_number":279,"context_line":"                                      self.node.target_provision_state)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        # set up the async worker"},{"line_number":282,"context_line":"        if callback:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_c12ac97d","line":279,"in_reply_to":"3a961159_2a2b6f31","updated":"2014-12-16 20:54:24.000000000","message":"It shouldn\u0027t matter, because self.fsm.process_event() doesn\u0027t modify the node. But it may be clearer if it is moved before the fsm.process_event() call.","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"0bb17ee8f1817645e21f7ce15e6aaa19116dec82","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        if err_handler:"},{"line_number":277,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":278,"context_line":"                                      self.node.provision_state,"},{"line_number":279,"context_line":"                                      self.node.target_provision_state)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        # set up the async worker"},{"line_number":282,"context_line":"        if callback:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_6273d4b1","line":279,"in_reply_to":"3a961159_c12ac97d","updated":"2014-12-16 21:05:49.000000000","message":"Ah, yes. You\u0027re right Ruby. I think I got lost in all the reviewing and was thinking of *this* process_event() and not fsm\u0027s process_event(). Though it does make me wonder if maybe we should rename one of them to prevent such confusion.","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"13612ceb6b95beffa1d09f66a67f84b0d1a32a0a","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        # publish the state transition by saving the Node"},{"line_number":290,"context_line":"        self.node.provision_state \u003d self.fsm.current_state"},{"line_number":291,"context_line":"        self.node.target_provision_state \u003d self.fsm.target_state"},{"line_number":292,"context_line":"        self.node.last_error \u003d None"},{"line_number":293,"context_line":"        self.node.save()"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_fc392a42","line":292,"updated":"2014-12-16 20:54:24.000000000","message":"Jenkins is failing on this. In this failure case, manager.do_node_tear_down() is setting .last_error before it calls this process_event(\u0027error\u0027), and then this clears it :-(\n\nWe could \n1. if callback: self.node.last_error \u003d None\n\nor 2. for all places where task.process_event() is called and where last_error needs to be set, that it is set after process_event() is called.\n\nor 3... ?\n\nI prefer 1.","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"57ad8e991fbdfc6159cd105bea574c24eecb92a8","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        # publish the state transition by saving the Node"},{"line_number":290,"context_line":"        self.node.provision_state \u003d self.fsm.current_state"},{"line_number":291,"context_line":"        self.node.target_provision_state \u003d self.fsm.target_state"},{"line_number":292,"context_line":"        self.node.last_error \u003d None"},{"line_number":293,"context_line":"        self.node.save()"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_79a7b050","line":292,"updated":"2014-12-19 03:26:07.000000000","message":"Thanks. Done.","commit_id":"bc7f6bea9c0344a3682613708291b3d54f99099a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e04bd2ea06af155a3e29cc0e13a27c64331148ce","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note that this does not alter the Node in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_ee655b1e","line":274,"updated":"2014-12-22 17:59:10.000000000","message":"You mean if InvalidState is raised, right? Because the Node is altered otherwise.","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"dffe2b4a1cc04e5c859c83501f6ea44133f2a4c3","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note that this does not alter the Node in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_e8d1d357","line":274,"in_reply_to":"3a961159_ee655b1e","updated":"2015-01-07 17:35:17.000000000","message":"Done","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"89585d29e4ffc7b32ba43b7f9e7154753ed2e768","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note If InvalidState is rasied the node is not altered in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a961159_e961d539","line":274,"updated":"2015-01-07 18:08:37.000000000","message":"Actually, I meant that fsm.process_event() does not modify the node at all. This was a comment added in response to a request from Ruby on a previous revision.\n\nThat said, I think the comment is fine.","commit_id":"93e90dfa3c455254189589baf428c1b7ab2106f6"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"d34dceaf0adbc20635e4ce03b31fe5e8f08502d9","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"},{"line_number":266,"context_line":"        :param call_kwargs: optional **kwargs to pass to to the callback method"},{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        :raises: InvalidState if the event is not allowed by the associated"},{"line_number":270,"context_line":"                 state machine"},{"line_number":271,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_ae324c5b","line":268,"updated":"2015-01-08 19:47:57.000000000","message":"I think it is worth mentioning the arguments we expect the error handler to take: node, prev_prov_state, prev_target_state","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        :param call_args: optional *args to pass to the callback method"},{"line_number":266,"context_line":"        :param call_kwargs: optional **kwargs to pass to to the callback method"},{"line_number":267,"context_line":"        :param err_handler: optional error handler to invoke if the"},{"line_number":268,"context_line":"                callback fails, eg. because there are no workers available"},{"line_number":269,"context_line":"        :raises: InvalidState if the event is not allowed by the associated"},{"line_number":270,"context_line":"                 state machine"},{"line_number":271,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_02f9534e","line":268,"in_reply_to":"3a961159_ae324c5b","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"d34dceaf0adbc20635e4ce03b31fe5e8f08502d9","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note If InvalidState is rasied the node is not altered in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_ae7fac15","line":274,"updated":"2015-01-08 19:47:57.000000000","message":"nit: s/rasied/raised/","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note If InvalidState is rasied the node is not altered in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_e2fb6746","line":274,"in_reply_to":"3a961159_ae7fac15","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fd7404133c1c25e1a5ba76c1363d6e06b7ff6604","unresolved":false,"context_lines":[{"line_number":289,"context_line":"            # clear the error if we\u0027re going to start work in a callback"},{"line_number":290,"context_line":"            self.node.last_error \u003d None"},{"line_number":291,"context_line":"            if call_args is None:"},{"line_number":292,"context_line":"                call_args \u003d []"},{"line_number":293,"context_line":"            if call_kwargs is None:"},{"line_number":294,"context_line":"                call_kwargs \u003d {}"},{"line_number":295,"context_line":"            self.spawn_after(callback, *call_args, **call_kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_cc232b56","line":292,"updated":"2015-01-08 14:58:12.000000000","message":"super nit: s/[]/()/","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":289,"context_line":"            # clear the error if we\u0027re going to start work in a callback"},{"line_number":290,"context_line":"            self.node.last_error \u003d None"},{"line_number":291,"context_line":"            if call_args is None:"},{"line_number":292,"context_line":"                call_args \u003d []"},{"line_number":293,"context_line":"            if call_kwargs is None:"},{"line_number":294,"context_line":"                call_kwargs \u003d {}"},{"line_number":295,"context_line":"            self.spawn_after(callback, *call_args, **call_kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_a26f9ffb","line":292,"in_reply_to":"3a961159_cc232b56","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3537923d07a2c01ea6a87192d7b0ce2e3065ba16","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note If InvalidState is rasied the node is not altered in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_c47cd022","line":274,"updated":"2015-01-09 03:18:23.000000000","message":"I had to go back to figure out how we got this comment/line. I think the idea was to add a comment that self.fsm.process_event() doesn\u0027t actually alter the node. And the reason for the comment is because someone could be confused and think this does alter the node (states), and that we should be saving the provision states before making this call.\n\nSo how about deleting this line (and not have to fix the \u0027rasied\u0027 typo) and instead, mentioning it after the first line \u0027Advance ... given event. Note that this doesn\u0027t alter the node in any way. This may raise ...\u0027 \n\nWould that be clearer?","commit_id":"4b9686ceb47bb1a961da0f640aacccb7a4872743"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"ff97a241b8110dbc3091b4ee75aa6a100afea24f","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        \"\"\""},{"line_number":272,"context_line":"        # Advance the state model for the given event. This may raise"},{"line_number":273,"context_line":"        # InvalidState, if this event is not allowed in the current state."},{"line_number":274,"context_line":"        # Note If InvalidState is rasied the node is not altered in any way."},{"line_number":275,"context_line":"        self.fsm.process_event(event)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # stash current states in the error handler,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_826aa3eb","line":274,"in_reply_to":"3a961159_c47cd022","updated":"2015-01-09 22:32:51.000000000","message":"Done","commit_id":"4b9686ceb47bb1a961da0f640aacccb7a4872743"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"627058a60f2ab5606f4c4dddd36ed74c7d3ae09a","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # stash current states in the error handler,"},{"line_number":280,"context_line":"        # in case we fail to get a worker from the pool"},{"line_number":281,"context_line":"        if err_handler:"},{"line_number":282,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":283,"context_line":"                                      self.node.provision_state,"},{"line_number":284,"context_line":"                                      self.node.target_provision_state)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_244658c1","line":281,"updated":"2015-01-10 05:01:24.000000000","message":"err_handler makes sense only if there is a callback.  So better to move it inside if callback I think. (though it doesn\u0027t make much difference).","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"72c1e4dc99084ab778e8fae72f17563f4b61462d","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # stash current states in the error handler,"},{"line_number":280,"context_line":"        # in case we fail to get a worker from the pool"},{"line_number":281,"context_line":"        if err_handler:"},{"line_number":282,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":283,"context_line":"                                      self.node.provision_state,"},{"line_number":284,"context_line":"                                      self.node.target_provision_state)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_d7b8c013","line":281,"in_reply_to":"3a961159_244658c1","updated":"2015-01-12 18:46:31.000000000","message":"You have to be careful if you move this code inside the \u0027if callback\u0027 because the node\u0027s provision states have changed, so you\u0027d need to keep track of the states before they are changed.","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"b379502d31ca6be275194f1f9d22639405e613b1","unresolved":false,"context_lines":[{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        # stash current states in the error handler,"},{"line_number":280,"context_line":"        # in case we fail to get a worker from the pool"},{"line_number":281,"context_line":"        if err_handler:"},{"line_number":282,"context_line":"            self.set_spawn_error_hook(err_handler, self.node,"},{"line_number":283,"context_line":"                                      self.node.provision_state,"},{"line_number":284,"context_line":"                                      self.node.target_provision_state)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_075bd322","line":281,"in_reply_to":"3a961159_d7b8c013","updated":"2015-01-13 16:36:07.000000000","message":"Instead of mucking around with saving the states, it\u0027ll be less work (and I think maybe easier to understand) if this is changed s/if err_handler/if callback and err_handler/","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"}],"ironic/tests/conductor/test_task_manager.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e04bd2ea06af155a3e29cc0e13a27c64331148ce","unresolved":false,"context_lines":[{"line_number":454,"context_line":"        self.assertIsNone(t.node)"},{"line_number":455,"context_line":"        self.assertIsNone(t.driver)"},{"line_number":456,"context_line":"        self.assertIsNone(t.ports)"},{"line_number":457,"context_line":"        self.assertIsNone(t.node)"},{"line_number":458,"context_line":"        self.assertIsNone(t.fsm)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def test_process_event_fsm_raises(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_696a45b4","line":457,"updated":"2014-12-22 17:59:10.000000000","message":"don\u0027t need this again","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"dffe2b4a1cc04e5c859c83501f6ea44133f2a4c3","unresolved":false,"context_lines":[{"line_number":454,"context_line":"        self.assertIsNone(t.node)"},{"line_number":455,"context_line":"        self.assertIsNone(t.driver)"},{"line_number":456,"context_line":"        self.assertIsNone(t.ports)"},{"line_number":457,"context_line":"        self.assertIsNone(t.node)"},{"line_number":458,"context_line":"        self.assertIsNone(t.fsm)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def test_process_event_fsm_raises(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_e80633cd","line":457,"in_reply_to":"3a961159_696a45b4","updated":"2015-01-07 17:35:17.000000000","message":"Done","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e04bd2ea06af155a3e29cc0e13a27c64331148ce","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        self.assertIsNone(t.node)"},{"line_number":458,"context_line":"        self.assertIsNone(t.fsm)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def test_process_event_fsm_raises(self):"},{"line_number":461,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":462,"context_line":"        self.fsm.process_event.side_effect \u003d exception.InvalidState(\u0027test\u0027)"},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_a9efcde7","line":460,"updated":"2014-12-22 17:59:10.000000000","message":"For these three tests, do we want to check if self.node\u0027s provision_state, target_provision_state, and last_error get (or don\u0027t get) set?","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"dffe2b4a1cc04e5c859c83501f6ea44133f2a4c3","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        self.assertIsNone(t.node)"},{"line_number":458,"context_line":"        self.assertIsNone(t.fsm)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def test_process_event_fsm_raises(self):"},{"line_number":461,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":462,"context_line":"        self.fsm.process_event.side_effect \u003d exception.InvalidState(\u0027test\u0027)"},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_4eff4f66","line":460,"in_reply_to":"3a961159_a9efcde7","updated":"2015-01-07 17:35:17.000000000","message":"Done","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"e04bd2ea06af155a3e29cc0e13a27c64331148ce","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        er \u003d mock.Mock()"},{"line_number":473,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        self.task.process_event(self.task, \u0027fake\u0027, err_handler\u003der)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"        self.fsm.process_event.assert_called_once_with(\u0027fake\u0027)"},{"line_number":478,"context_line":"        self.task.set_spawn_error_hook.assert_called_with("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_4943c912","line":475,"updated":"2014-12-22 17:59:10.000000000","message":"I think of \u0027fake\u0027 for the fake driver. I was thinking it might be easier to understand if this were something like \u0027event\u0027. Or \u0027fake_event\u0027 (hmm, too long).","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"dffe2b4a1cc04e5c859c83501f6ea44133f2a4c3","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        er \u003d mock.Mock()"},{"line_number":473,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        self.task.process_event(self.task, \u0027fake\u0027, err_handler\u003der)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"        self.fsm.process_event.assert_called_once_with(\u0027fake\u0027)"},{"line_number":478,"context_line":"        self.task.set_spawn_error_hook.assert_called_with("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_8e693727","line":475,"in_reply_to":"3a961159_4943c912","updated":"2015-01-07 17:35:17.000000000","message":"Done","commit_id":"bac5720330a8fac87766637767685260077563a2"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fd7404133c1c25e1a5ba76c1363d6e06b7ff6604","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                  reserve_mock, release_mock, node_get_mock):"},{"line_number":427,"context_line":"        m \u003d mock.Mock(spec\u003dfsm.FSM)"},{"line_number":428,"context_line":"        reserve_mock.return_value \u003d self.node"},{"line_number":429,"context_line":"        with mock.patch.object(states.machine, \u0027copy\u0027) as copy_mock:"},{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_ecdd4742","line":429,"updated":"2015-01-08 14:58:12.000000000","message":"maybe move it to a decorator?","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                  reserve_mock, release_mock, node_get_mock):"},{"line_number":427,"context_line":"        m \u003d mock.Mock(spec\u003dfsm.FSM)"},{"line_number":428,"context_line":"        reserve_mock.return_value \u003d self.node"},{"line_number":429,"context_line":"        with mock.patch.object(states.machine, \u0027copy\u0027) as copy_mock:"},{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_9d284435","line":429,"in_reply_to":"3a961159_ecdd4742","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fd7404133c1c25e1a5ba76c1363d6e06b7ff6604","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        with mock.patch.object(states.machine, \u0027copy\u0027) as copy_mock:"},{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"},{"line_number":433,"context_line":"            self.assertEqual(m, t.fsm)"},{"line_number":434,"context_line":"        m.initialize.assert_called_once_with(self.node.provision_state)"},{"line_number":435,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_6ce957e2","line":432,"updated":"2015-01-08 14:58:12.000000000","message":"nit: copy_mock.assert_called_once_with()","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        with mock.patch.object(states.machine, \u0027copy\u0027) as copy_mock:"},{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"},{"line_number":433,"context_line":"            self.assertEqual(m, t.fsm)"},{"line_number":434,"context_line":"        m.initialize.assert_called_once_with(self.node.provision_state)"},{"line_number":435,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_1d1454e8","line":432,"in_reply_to":"3a961159_6ce957e2","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fd7404133c1c25e1a5ba76c1363d6e06b7ff6604","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"},{"line_number":433,"context_line":"            self.assertEqual(m, t.fsm)"},{"line_number":434,"context_line":"        m.initialize.assert_called_once_with(self.node.provision_state)"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_2ccaef6d","line":433,"updated":"2015-01-08 14:58:12.000000000","message":"maybe even assertIs?","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            copy_mock.return_value \u003d m"},{"line_number":431,"context_line":"            t \u003d task_manager.TaskManager(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":432,"context_line":"            self.assertEqual(1, copy_mock.call_count)"},{"line_number":433,"context_line":"            self.assertEqual(m, t.fsm)"},{"line_number":434,"context_line":"        m.initialize.assert_called_once_with(self.node.provision_state)"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_3d8cb02e","line":433,"in_reply_to":"3a961159_2ccaef6d","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fd7404133c1c25e1a5ba76c1363d6e06b7ff6604","unresolved":false,"context_lines":[{"line_number":465,"context_line":"                self.task.process_event,"},{"line_number":466,"context_line":"                self.task, \u0027fake\u0027)"},{"line_number":467,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":468,"context_line":"        self.assertEqual(0, self.task.node.save.call_count)"},{"line_number":469,"context_line":"        self.assertIsNotNone(self.task.node.last_error)"},{"line_number":470,"context_line":"        self.assertIsNotNone(self.task.node.provision_state)"},{"line_number":471,"context_line":"        self.assertIsNotNone(self.task.node.target_provision_state)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_cca88b8e","line":468,"updated":"2015-01-08 14:58:12.000000000","message":"super nit: self.assertFalse(self.task.node.save.called)","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"e76aa27995228f2b4db467193ee84c74d1d46620","unresolved":false,"context_lines":[{"line_number":465,"context_line":"                self.task.process_event,"},{"line_number":466,"context_line":"                self.task, \u0027fake\u0027)"},{"line_number":467,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":468,"context_line":"        self.assertEqual(0, self.task.node.save.call_count)"},{"line_number":469,"context_line":"        self.assertIsNotNone(self.task.node.last_error)"},{"line_number":470,"context_line":"        self.assertIsNotNone(self.task.node.provision_state)"},{"line_number":471,"context_line":"        self.assertIsNotNone(self.task.node.target_provision_state)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_1da7f4a8","line":468,"in_reply_to":"3a961159_cca88b8e","updated":"2015-01-09 22:31:58.000000000","message":"Done","commit_id":"c02bec61ff33fc211a89ec8a0e6121e220b1a517"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3537923d07a2c01ea6a87192d7b0ce2e3065ba16","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        self.assertEqual(0, self.task.node.save.call_count)"},{"line_number":469,"context_line":"        self.assertIsNotNone(self.task.node.last_error)"},{"line_number":470,"context_line":"        self.assertIsNotNone(self.task.node.provision_state)"},{"line_number":471,"context_line":"        self.assertIsNotNone(self.task.node.target_provision_state)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"    def test_process_event_sets_err_handler(self):"},{"line_number":474,"context_line":"        er \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_7f5565c0","line":471,"updated":"2015-01-09 03:18:23.000000000","message":"Sorry, I\u0027m the one that suggested checking if self.node\u0027s provision_state, target_provision_state, and last_error get (or don\u0027t get) set. The problem with this is that self.node is mocked so this doesn\u0027t test what I wanted to test.\n\nI\u0027m fine if we don\u0027t test for them.","commit_id":"4b9686ceb47bb1a961da0f640aacccb7a4872743"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"ff97a241b8110dbc3091b4ee75aa6a100afea24f","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        self.assertEqual(0, self.task.node.save.call_count)"},{"line_number":469,"context_line":"        self.assertIsNotNone(self.task.node.last_error)"},{"line_number":470,"context_line":"        self.assertIsNotNone(self.task.node.provision_state)"},{"line_number":471,"context_line":"        self.assertIsNotNone(self.task.node.target_provision_state)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"    def test_process_event_sets_err_handler(self):"},{"line_number":474,"context_line":"        er \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_5db89cc7","line":471,"in_reply_to":"3a961159_7f5565c0","updated":"2015-01-09 22:32:51.000000000","message":"Done","commit_id":"4b9686ceb47bb1a961da0f640aacccb7a4872743"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"627058a60f2ab5606f4c4dddd36ed74c7d3ae09a","unresolved":false,"context_lines":[{"line_number":464,"context_line":"        self.assertRaises("},{"line_number":465,"context_line":"                exception.InvalidState,"},{"line_number":466,"context_line":"                self.task.process_event,"},{"line_number":467,"context_line":"                self.task, \u0027fake\u0027)"},{"line_number":468,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":469,"context_line":"        self.assertFalse(self.task.node.save.called)"},{"line_number":470,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_a4096886","line":467,"updated":"2015-01-10 05:01:24.000000000","message":"spawn_after would be called only if there is a call back. So I guess it makes sense to add a dummy callback as well while doing process_event and it makes assertion below more meaningful.","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"627058a60f2ab5606f4c4dddd36ed74c7d3ae09a","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":469,"context_line":"        self.assertFalse(self.task.node.save.called)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def test_process_event_sets_err_handler(self):"},{"line_number":472,"context_line":"        er \u003d mock.Mock()"},{"line_number":473,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":474,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_04207cf7","line":471,"updated":"2015-01-10 05:01:24.000000000","message":"Give that err_handler makes sense only if there is a callback, can we merge test_process_event_sets_err_handler and test_process_event_sets_callback into one ?","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"72c1e4dc99084ab778e8fae72f17563f4b61462d","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":469,"context_line":"        self.assertFalse(self.task.node.save.called)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def test_process_event_sets_err_handler(self):"},{"line_number":472,"context_line":"        er \u003d mock.Mock()"},{"line_number":473,"context_line":"        self.task.process_event \u003d task_manager.TaskManager.process_event"},{"line_number":474,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_378024f7","line":471,"in_reply_to":"3a961159_04207cf7","updated":"2015-01-12 18:46:31.000000000","message":"Yeah, Ramakrishnan has a good point.","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"627058a60f2ab5606f4c4dddd36ed74c7d3ae09a","unresolved":false,"context_lines":[{"line_number":475,"context_line":"        self.task.process_event(self.task, \u0027fakeEvent\u0027, err_handler\u003der)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"        self.fsm.process_event.assert_called_once_with(\u0027fakeEvent\u0027)"},{"line_number":478,"context_line":"        self.task.set_spawn_error_hook.assert_called_with("},{"line_number":479,"context_line":"                er, mock.ANY, mock.ANY, mock.ANY)"},{"line_number":480,"context_line":"        self.assertEqual(1, self.task.node.save.call_count)"},{"line_number":481,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_24ef38b3","line":478,"updated":"2015-01-10 05:01:24.000000000","message":"I think we can replace mock.ANY with specifics.\n\nWe may say some provision_state and target_provision_state for self.node before doing process_event and then do \n\n  self.task.set_spawn_error_hook.assert_called_once_with(er, self.node, provision_state, target_provision_state)","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"627058a60f2ab5606f4c4dddd36ed74c7d3ae09a","unresolved":false,"context_lines":[{"line_number":479,"context_line":"                er, mock.ANY, mock.ANY, mock.ANY)"},{"line_number":480,"context_line":"        self.assertEqual(1, self.task.node.save.call_count)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"    def test_process_event_sets_callback(self):"},{"line_number":483,"context_line":"        cb \u003d mock.Mock()"},{"line_number":484,"context_line":"        arg \u003d mock.Mock()"},{"line_number":485,"context_line":"        kwarg \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_842d4c00","line":482,"updated":"2015-01-10 05:01:24.000000000","message":"May be also check if node\u0027s last_error is cleared ?","commit_id":"103ebb096ed79d28a4c1f4d8c92d2291eeee601d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9fec6f09bdbfc227f66ad4c470748e4416335cfd","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        self.assertEqual(0, self.task.spawn_after.call_count)"},{"line_number":469,"context_line":"        self.assertFalse(self.task.node.save.called)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def test_process_event_sets_callback_and_error_handler(self):"},{"line_number":472,"context_line":"        arg \u003d mock.Mock()"},{"line_number":473,"context_line":"        cb \u003d mock.Mock()"},{"line_number":474,"context_line":"        er \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_4837ab4d","line":471,"updated":"2015-01-13 18:02:07.000000000","message":"callback can be done w/o an error handler being specified so I think there is value in keeping test_process_event_sets_callback() (from previous version, and checking if node\u0027s last_error is cleared).","commit_id":"b28c8864acf7470a279df90651532669200c1ad4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9fec6f09bdbfc227f66ad4c470748e4416335cfd","unresolved":false,"context_lines":[{"line_number":480,"context_line":"                err_handler\u003der)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        self.task.set_spawn_error_hook.assert_called_once_with(er,"},{"line_number":483,"context_line":"                self.node, mock.ANY, mock.ANY)"},{"line_number":484,"context_line":"        self.fsm.process_event.assert_called_once_with(\u0027fake\u0027)"},{"line_number":485,"context_line":"        self.task.spawn_after.assert_called_with(cb, arg, mock\u003dkwarg)"},{"line_number":486,"context_line":"        self.assertEqual(1, self.task.node.save.call_count)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_0862033d","line":483,"updated":"2015-01-13 18:02:07.000000000","message":"Ramakrishnan had a comment about this -- we can use provision_state and target_provision_state here.\n\nso eg, around line 475 you could:\n   provision_state \u003d \u0027provision_state\u0027\n   target_provision_state \u003d \u0027target\u0027\n    self.node.provision_state \u003d provision_state\n    self.node.target_provision_state \u003d target_provision_state\n\n and here, use provision_state, target_provision_state.\n\nBut then, someone may ask to check that the states changed, so you might want to add at the end eg:\n    self.assertNotEqual(provision_state, self.node.provision_state)\n    self.assertNotEqual(target_provision_state, self.node.target_provision_state)","commit_id":"b28c8864acf7470a279df90651532669200c1ad4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"461b54ae36c77780b5828fe3f4e9ef12df60af0e","unresolved":false,"context_lines":[{"line_number":485,"context_line":"        self.task.spawn_after.assert_called_with(cb, arg, mock\u003dkwarg)"},{"line_number":486,"context_line":"        self.assertEqual(1, self.task.node.save.call_count)"},{"line_number":487,"context_line":"        self.assertIsNone(self.node.last_error)"},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"@task_manager.require_exclusive_lock"},{"line_number":490,"context_line":"def _req_excl_lock_method(*args, **kwargs):"},{"line_number":491,"context_line":"    return (args, kwargs)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a961159_ab6ac97e","line":488,"updated":"2015-01-13 18:08:36.000000000","message":"pep8 error here, need another blank line","commit_id":"b28c8864acf7470a279df90651532669200c1ad4"}]}
