)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"b663adc7982a51907786e4eb72c38ce392c5e0fa","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field is holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_f1ce2cb6","line":10,"updated":"2016-06-09 15:51:10.000000000","message":"s/is //","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59432767d07d31e48a9ced7065ad0852156c476c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field is holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_954ab881","line":10,"in_reply_to":"7aa08908_f1ce2cb6","updated":"2016-06-17 15:07:13.000000000","message":"Done","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"b663adc7982a51907786e4eb72c38ce392c5e0fa","unresolved":false,"context_lines":[{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The database filters for retrieving the nodes based on date/time is also"},{"line_number":15,"context_line":"part of this patch."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The ReST API part is not included as part of this patch. The API can be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_d1d3305e","line":14,"updated":"2016-06-09 15:51:10.000000000","message":"s/is/are","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59432767d07d31e48a9ced7065ad0852156c476c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The database filters for retrieving the nodes based on date/time is also"},{"line_number":15,"context_line":"part of this patch."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The ReST API part is not included as part of this patch. The API can be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_754f4c92","line":14,"in_reply_to":"7aa08908_d1d3305e","updated":"2016-06-17 15:07:13.000000000","message":"Done","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"b663adc7982a51907786e4eb72c38ce392c5e0fa","unresolved":false,"context_lines":[{"line_number":15,"context_line":"part of this patch."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The ReST API part is not included as part of this patch. The API can be"},{"line_number":18,"context_line":"done as a separated patch because it already has it\u0027s own complexity"},{"line_number":19,"context_line":"such as adding a new microversion, hiding the new field for older API"},{"line_number":20,"context_line":"versions and so on."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_31c9d4ad","line":18,"updated":"2016-06-09 15:51:10.000000000","message":"s/separated/separate\ns/it\u0027s/its","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59432767d07d31e48a9ced7065ad0852156c476c","unresolved":false,"context_lines":[{"line_number":15,"context_line":"part of this patch."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The ReST API part is not included as part of this patch. The API can be"},{"line_number":18,"context_line":"done as a separated patch because it already has it\u0027s own complexity"},{"line_number":19,"context_line":"such as adding a new microversion, hiding the new field for older API"},{"line_number":20,"context_line":"versions and so on."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_d540c061","line":18,"in_reply_to":"7aa08908_31c9d4ad","updated":"2016-06-17 15:07:13.000000000","message":"Done","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"89f6cf73fd546396ea33b8d57483ba24d48aef40","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a9d85d2_f893aa4d","line":9,"updated":"2016-06-20 12:00:58.000000000","message":"nit: \"started_at\"","commit_id":"58cdfc9afe13942dd7fc9fcefe5440405fcf0b12"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ec0a5fabd7360aa82ab9618a02e715d1668286df","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a9d85d2_20f330a0","line":9,"in_reply_to":"5a9d85d2_f893aa4d","updated":"2016-06-20 14:50:11.000000000","message":"ops :-/ will fix it if I happen to submit a new patch-set","commit_id":"58cdfc9afe13942dd7fc9fcefe5440405fcf0b12"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"28bf4189f7a8bb6efdb1b6d30b61cebe8e919451","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3aaa91ec_9565261f","line":9,"range":{"start_line":9,"start_character":63,"end_line":9,"end_character":70},"updated":"2016-07-01 14:07:42.000000000","message":"s/starter/started/","commit_id":"7359a908c82e1bfac4741cd62ccb9d00b8b95790"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"6b78b7c0ddd31db9f1b3b8c69786ee85d9feb27e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add power_transition_started_at to the nodes table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is introducing a new field called \"power_transition_starter_at\""},{"line_number":10,"context_line":"to the nodes database table. This field holds the UTC date and time"},{"line_number":11,"context_line":"when the power state transition was started and will later be used for"},{"line_number":12,"context_line":"calculating a timeout for power state transitions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1aa78d24_4d975e90","line":9,"updated":"2016-07-05 11:33:04.000000000","message":"Nit: \"started\"","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"}],"ironic/conductor/utils.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"b4e13ffb8655f075a92ae7633baade49f804bc97","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                node[\u0027last_error\u0027] \u003d _("},{"line_number":93,"context_line":"                    \"Failed to change power state to \u0027%(target)s\u0027. \""},{"line_number":94,"context_line":"                    \"Error: %(error)s\") % {\u0027target\u0027: new_state, \u0027error\u0027: e}"},{"line_number":95,"context_line":"                node[\u0027target_power_state\u0027] \u003d states.NOSTATE"},{"line_number":96,"context_line":"                node[\u0027power_transition_started_at\u0027] \u003d None"},{"line_number":97,"context_line":"                node.save()"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_9207fc80","line":95,"updated":"2016-06-27 12:52:11.000000000","message":"One suggestion, because 1) 3-party drivers can use own utility instead of node_power_action() 2) We set \u0027power_transition_started_at\u0027 at DB api level and cleaning in node_power_action(). Maybe use \u0027target_power_state\u0027 to NOSTATE in db api for cleaning?","commit_id":"1ddadbce17b1c4cab63aeed84c9732b8271261d1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c007064568b8a9e9b6c48a4da03bb8763e596a0b","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                node[\u0027last_error\u0027] \u003d _("},{"line_number":93,"context_line":"                    \"Failed to change power state to \u0027%(target)s\u0027. \""},{"line_number":94,"context_line":"                    \"Error: %(error)s\") % {\u0027target\u0027: new_state, \u0027error\u0027: e}"},{"line_number":95,"context_line":"                node[\u0027target_power_state\u0027] \u003d states.NOSTATE"},{"line_number":96,"context_line":"                node[\u0027power_transition_started_at\u0027] \u003d None"},{"line_number":97,"context_line":"                node.save()"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_9fecee90","line":95,"in_reply_to":"3aaa91ec_9207fc80","updated":"2016-06-28 10:07:05.000000000","message":"I\u0027m sorry, not sure if I get the suggestion here. Setting target_power_state to NOSTATE in the db api for cleaning? Wouldn\u0027t that be outside of the scope of this patch?","commit_id":"1ddadbce17b1c4cab63aeed84c9732b8271261d1"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"b663adc7982a51907786e4eb72c38ce392c5e0fa","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            filters \u003d []"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":196,"context_line":"        # pep8, we should to simplify it."},{"line_number":197,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if \u0027chassis_uuid\u0027 in filters:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_11ce58b4","line":196,"updated":"2016-06-09 15:51:10.000000000","message":"s/to //","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59432767d07d31e48a9ced7065ad0852156c476c","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            filters \u003d []"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":196,"context_line":"        # pep8, we should to simplify it."},{"line_number":197,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if \u0027chassis_uuid\u0027 in filters:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_95bc786d","line":196,"in_reply_to":"7aa08908_11ce58b4","updated":"2016-06-17 15:07:13.000000000","message":"Done","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"b663adc7982a51907786e4eb72c38ce392c5e0fa","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if \u0027console_enabled\u0027 in filters:"},{"line_number":226,"context_line":"            query \u003d query.filter_by(console_enabled\u003dfilters[\u0027console_enabled\u0027])"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # A dictionary whose keys are the name of the filter and the values"},{"line_number":229,"context_line":"        # the name of the node attribute holding the date"},{"line_number":230,"context_line":"        before_filters \u003d {"},{"line_number":231,"context_line":"            \u0027provisioned_before\u0027: \u0027provision_updated_at\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_71c35c8b","line":228,"updated":"2016-06-09 15:51:10.000000000","message":"This section could be factored out into a new method, say _apply_timeout_filters","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59432767d07d31e48a9ced7065ad0852156c476c","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if \u0027console_enabled\u0027 in filters:"},{"line_number":226,"context_line":"            query \u003d query.filter_by(console_enabled\u003dfilters[\u0027console_enabled\u0027])"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # A dictionary whose keys are the name of the filter and the values"},{"line_number":229,"context_line":"        # the name of the node attribute holding the date"},{"line_number":230,"context_line":"        before_filters \u003d {"},{"line_number":231,"context_line":"            \u0027provisioned_before\u0027: \u0027provision_updated_at\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_157888c3","line":228,"in_reply_to":"7aa08908_71c35c8b","updated":"2016-06-17 15:07:13.000000000","message":"indeed, will do that","commit_id":"dd960eaf7ba8ccca16eb32d4acef72c1f1acc821"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"89f6cf73fd546396ea33b8d57483ba24d48aef40","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        if filters is None:"},{"line_number":211,"context_line":"            filters \u003d []"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":214,"context_line":"        # pep8, we should simplify it."},{"line_number":215,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_98b0a68d","line":213,"updated":"2016-06-20 12:00:58.000000000","message":"It looks like this is now fixed?","commit_id":"58cdfc9afe13942dd7fc9fcefe5440405fcf0b12"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ec0a5fabd7360aa82ab9618a02e715d1668286df","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        if filters is None:"},{"line_number":211,"context_line":"            filters \u003d []"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":214,"context_line":"        # pep8, we should simplify it."},{"line_number":215,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_a0d1e0cf","line":213,"in_reply_to":"5a9d85d2_98b0a68d","updated":"2016-06-20 14:50:11.000000000","message":"Yeah, I decided to leave this FIXME anyway because there\u0027re still a lot of conditionals in this method, I think we could simplify by grouping similar queries into their own function (e.g, the ones that only add a filter_by() without any other logic)","commit_id":"58cdfc9afe13942dd7fc9fcefe5440405fcf0b12"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"b4e13ffb8655f075a92ae7633baade49f804bc97","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"            if (\u0027target_power_state\u0027 in values and"},{"line_number":458,"context_line":"                \u0027power_transition_started_at\u0027 not in values):"},{"line_number":459,"context_line":"                values[\u0027power_transition_started_at\u0027] \u003d timeutils.utcnow()"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"            ref.update(values)"},{"line_number":462,"context_line":"        return ref"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_55ed7eee","line":459,"updated":"2016-06-27 12:52:11.000000000","message":"At this level we can set \u0027power_transition_started_at\u0027 even if target state is NOSTATE and we forgot add \u0027power_transition_started_at\u0027 to this update.\n\n node.target_power_state \u003d states.NOSTATE\n node.save()\n node.power_transition_started_at \u003d None\n node.save()","commit_id":"1ddadbce17b1c4cab63aeed84c9732b8271261d1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c007064568b8a9e9b6c48a4da03bb8763e596a0b","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"            if (\u0027target_power_state\u0027 in values and"},{"line_number":458,"context_line":"                \u0027power_transition_started_at\u0027 not in values):"},{"line_number":459,"context_line":"                values[\u0027power_transition_started_at\u0027] \u003d timeutils.utcnow()"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"            ref.update(values)"},{"line_number":462,"context_line":"        return ref"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_ffda52e8","line":459,"in_reply_to":"3aaa91ec_55ed7eee","updated":"2016-06-28 10:07:05.000000000","message":"agreed","commit_id":"1ddadbce17b1c4cab63aeed84c9732b8271261d1"},{"author":{"_account_id":19072,"name":"Xavier","email":"marcusrafael@lsd.ufcg.edu.br","username":"marcusrafael"},"change_message_id":"b619783e923060467dd324552b968abc98ccc72b","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            filters \u003d []"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":214,"context_line":"        # pep8, we should simplify it."},{"line_number":215,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if \u0027chassis_uuid\u0027 in filters:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_d00f592c","line":214,"range":{"start_line":214,"start_character":16,"end_line":214,"end_character":37},"updated":"2016-07-05 14:37:00.000000000","message":"I was taking a look for a way of refactoring (Fowler\u0027s book) that method but none of them seems to fit here. The most obvious solution, extract methods, would work fine, but we have so many different properties that would be painful to maintain if turn them into new methods (too granular). Do you have some refactor in mind for this, Lucas?","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"d9934d2fe494a40795a9d0cf2347eb2288d31746","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            filters \u003d []"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        # FIXME(lucasagomes): This method is too complex according to"},{"line_number":214,"context_line":"        # pep8, we should simplify it."},{"line_number":215,"context_line":"        # Error: C901 \u0027Connection._add_nodes_filters\u0027 is too complex (17)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        if \u0027chassis_uuid\u0027 in filters:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_335a2750","line":214,"in_reply_to":"1aa78d24_d00f592c","updated":"2016-07-05 15:03:17.000000000","message":"One simplification occurs to me:\n\nfor attr in [\u0027maintenance\u0027, \u0027driver\u0027, \u0027provision_state\u0027, \u0027power_state\u0027, \u0027console_enabled\u0027]:\n    query \u003d query.filter_by(**{attr: filters[attr]})\n\nOr maybe\n\nsimple_attrs \u003d [\u0027maintenance\u0027, \u0027driver\u0027, \u0027provision_state\u0027, \u0027power_state\u0027, \u0027console_enabled\u0027]\nsimple_filters \u003d { k: filters[k] for k in simple_attrs if k in filters }\nif simple_filters:\n    query \u003d query.filter_by(simple_filters)\n\nBut maybe those are both too magical: WDYT?","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"6b78b7c0ddd31db9f1b3b8c69786ee85d9feb27e","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            query \u003d query.filter_by(driver\u003dfilters[\u0027driver\u0027])"},{"line_number":239,"context_line":"        if \u0027provision_state\u0027 in filters:"},{"line_number":240,"context_line":"            query \u003d query.filter_by(provision_state\u003dfilters[\u0027provision_state\u0027])"},{"line_number":241,"context_line":"        if \u0027power_state\u0027 in filters:"},{"line_number":242,"context_line":"            query \u003d query.filter_by(power_state\u003dfilters[\u0027power_state\u0027])"},{"line_number":243,"context_line":"        if \u0027console_enabled\u0027 in filters:"},{"line_number":244,"context_line":"            query \u003d query.filter_by(console_enabled\u003dfilters[\u0027console_enabled\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_ad0882da","line":241,"updated":"2016-07-05 11:33:04.000000000","message":"Wasn\u0027t it possible to filter by power state before? If not, you should probably mention this in the commit message.","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"fc3d0e733683ce089a31d364c3ff40a39731316a","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            query \u003d query.filter_by(driver\u003dfilters[\u0027driver\u0027])"},{"line_number":239,"context_line":"        if \u0027provision_state\u0027 in filters:"},{"line_number":240,"context_line":"            query \u003d query.filter_by(provision_state\u003dfilters[\u0027provision_state\u0027])"},{"line_number":241,"context_line":"        if \u0027power_state\u0027 in filters:"},{"line_number":242,"context_line":"            query \u003d query.filter_by(power_state\u003dfilters[\u0027power_state\u0027])"},{"line_number":243,"context_line":"        if \u0027console_enabled\u0027 in filters:"},{"line_number":244,"context_line":"            query \u003d query.filter_by(console_enabled\u003dfilters[\u0027console_enabled\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_93167b53","line":241,"in_reply_to":"1aa78d24_76930250","updated":"2016-07-05 15:03:48.000000000","message":"I was wondering if maybe this appeared as a result of a rebase...","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":19072,"name":"Xavier","email":"marcusrafael@lsd.ufcg.edu.br","username":"marcusrafael"},"change_message_id":"b619783e923060467dd324552b968abc98ccc72b","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            query \u003d query.filter_by(driver\u003dfilters[\u0027driver\u0027])"},{"line_number":239,"context_line":"        if \u0027provision_state\u0027 in filters:"},{"line_number":240,"context_line":"            query \u003d query.filter_by(provision_state\u003dfilters[\u0027provision_state\u0027])"},{"line_number":241,"context_line":"        if \u0027power_state\u0027 in filters:"},{"line_number":242,"context_line":"            query \u003d query.filter_by(power_state\u003dfilters[\u0027power_state\u0027])"},{"line_number":243,"context_line":"        if \u0027console_enabled\u0027 in filters:"},{"line_number":244,"context_line":"            query \u003d query.filter_by(console_enabled\u003dfilters[\u0027console_enabled\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_76930250","line":241,"in_reply_to":"1aa78d24_ad0882da","updated":"2016-07-05 14:37:00.000000000","message":"Yes, thats true. But I\u0027m curious, why it wasn\u0027t possible to filter by power state before?","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"}],"ironic/objects/node.py":[{"author":{"_account_id":19072,"name":"Xavier","email":"marcusrafael@lsd.ufcg.edu.br","username":"marcusrafael"},"change_message_id":"b619783e923060467dd324552b968abc98ccc72b","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        \u0027provision_state\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":92,"context_line":"        \u0027provision_updated_at\u0027: object_fields.DateTimeField(nullable\u003dTrue),"},{"line_number":93,"context_line":"        \u0027power_transition_started_at\u0027: object_fields.DateTimeField("},{"line_number":94,"context_line":"            nullable\u003dTrue),"},{"line_number":95,"context_line":"        \u0027target_provision_state\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        \u0027maintenance\u0027: object_fields.BooleanField(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_168b9ec4","line":94,"range":{"start_line":93,"start_character":0,"end_line":94,"end_character":27},"updated":"2016-07-05 14:37:00.000000000","message":"nit: since it is related to power, what about move to line 90?","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"}],"ironic/tests/unit/db/test_nodes.py":[{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"6b78b7c0ddd31db9f1b3b8c69786ee85d9feb27e","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        past \u003d datetime.datetime(2000, 1, 1, 0, 0)"},{"line_number":220,"context_line":"        next \u003d past + datetime.timedelta(minutes\u003d8)"},{"line_number":221,"context_line":"        present \u003d past + datetime.timedelta(minutes\u003d10)"},{"line_number":222,"context_line":"        mock_utcnow.return_value \u003d past"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        # node with provision_updated timeout"},{"line_number":225,"context_line":"        node1 \u003d utils.create_test_node(uuid\u003duuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_4de8fee2","line":222,"updated":"2016-07-05 11:33:04.000000000","message":"Should this be `mock_utcnow.return_value \u003d present`? That\u0027s what the variable names suggest...","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":18893,"name":"Miles Gould","email":"mgould@redhat.com","username":"pozorvlak"},"change_message_id":"6b78b7c0ddd31db9f1b3b8c69786ee85d9feb27e","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        mock_utcnow.return_value \u003d past"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        # node with provision_updated timeout"},{"line_number":225,"context_line":"        node1 \u003d utils.create_test_node(uuid\u003duuidutils.generate_uuid(),"},{"line_number":226,"context_line":"                                       power_transition_started_at\u003dpast)"},{"line_number":227,"context_line":"        node1.power_transition_started_at \u003d past"},{"line_number":228,"context_line":"        # node with None in power_transition_started_at"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_ada402b9","line":225,"updated":"2016-07-05 11:33:04.000000000","message":"It looks like we should make uuid\u003duuidutils.generate_uuid() the default.","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"},{"author":{"_account_id":19072,"name":"Xavier","email":"marcusrafael@lsd.ufcg.edu.br","username":"marcusrafael"},"change_message_id":"b619783e923060467dd324552b968abc98ccc72b","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        # node with provision_updated timeout"},{"line_number":225,"context_line":"        node1 \u003d utils.create_test_node(uuid\u003duuidutils.generate_uuid(),"},{"line_number":226,"context_line":"                                       power_transition_started_at\u003dpast)"},{"line_number":227,"context_line":"        node1.power_transition_started_at \u003d past"},{"line_number":228,"context_line":"        # node with None in power_transition_started_at"},{"line_number":229,"context_line":"        node2 \u003d utils.create_test_node(uuid\u003duuidutils.generate_uuid(),"},{"line_number":230,"context_line":"                                       power_state\u003dstates.POWER_OFF)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_dbd2dfd1","line":227,"range":{"start_line":227,"start_character":8,"end_line":227,"end_character":48},"updated":"2016-07-05 14:37:00.000000000","message":"Is it even necessary since the \u0027power_transition_started_at\u0027 is passed when creating the test node? L226","commit_id":"9900ae7ed0179d5070dbff3210a1658641e174c6"}]}
