)]}'
{"quantum/db/l3_db.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"ff0af0337cccc7142f0f0e20b3cbdd67e83a330e","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                  *conditions)"},{"line_number":93,"context_line":"        return conditions"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _network_result_filter_hook(self, query, filters):"},{"line_number":96,"context_line":"        vals \u003d filters and filters.get(\u0027router:external\u0027, [])"},{"line_number":97,"context_line":"        if not vals:"},{"line_number":98,"context_line":"            return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2Bka0%3D","line":95,"updated":"2013-02-27 03:02:31.000000000","message":"how about modifying the _network_filter_hook above?","commit_id":"0156ec175cc047826b211727d43d5d14a3e1f2d2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                  *conditions)"},{"line_number":93,"context_line":"        return conditions"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _network_result_filter_hook(self, query, filters):"},{"line_number":96,"context_line":"        vals \u003d filters and filters.get(\u0027router:external\u0027, [])"},{"line_number":97,"context_line":"        if not vals:"},{"line_number":98,"context_line":"            return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAANH%2F%2F%2F0I%3D","line":95,"in_reply_to":"AAAAM3%2F%2BjPo%3D","updated":"2013-02-28 00:09:16.000000000","message":"I have see the  previous hooks again, we have no filters parameter passed in. So previous hooks are too early to fix the problem. So Salvatore,  I wait for your opinion for this patch","commit_id":"0156ec175cc047826b211727d43d5d14a3e1f2d2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"54779a09a48ecc52c875ed56c5eefd04e083e5d4","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                  *conditions)"},{"line_number":93,"context_line":"        return conditions"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _network_result_filter_hook(self, query, filters):"},{"line_number":96,"context_line":"        vals \u003d filters and filters.get(\u0027router:external\u0027, [])"},{"line_number":97,"context_line":"        if not vals:"},{"line_number":98,"context_line":"            return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAANH%2F%2F%2F1A%3D","line":95,"in_reply_to":"AAAAM3%2F%2BjPo%3D","updated":"2013-02-28 04:46:10.000000000","message":"Salvatore, thanks for your explain! And we need upgrade our hook mechanism in future. Currently we execute register function in class, that means hooks will be registered when import module. And all hooks register in QuantumDbPluginV2._model_query_hooks. If we enable multiple plugin(they all register hooks too.) run at same time,  that will failed. And upgrade for many other reason, eg, sorting and filter with extended property. Definitely we will do this in Havana.","commit_id":"0156ec175cc047826b211727d43d5d14a3e1f2d2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                  *conditions)"},{"line_number":93,"context_line":"        return conditions"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _network_result_filter_hook(self, query, filters):"},{"line_number":96,"context_line":"        vals \u003d filters and filters.get(\u0027router:external\u0027, [])"},{"line_number":97,"context_line":"        if not vals:"},{"line_number":98,"context_line":"            return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2BjPo%3D","line":95,"in_reply_to":"AAAAM3%2F%2BkUc%3D","updated":"2013-02-27 18:25:48.000000000","message":"Alex has a good point.\nthe hooks are conceived for \u0027building\u0027 the query that needs to be presented to the plugin for processing.\n\nFor instance in this case it builds a query where external networks are returned even if they\u0027re not owned by the tenant submitting the request.\n\nAt a later stage we apply the real filtering conditions. _apply_filters_for_query works only if the API names matches the DB column name.\n\nThe way in which Alex is registering another hook definetely helps. I\u0027ll see if we can find a better approach, otherwise we will keep this fro grizzly.","commit_id":"0156ec175cc047826b211727d43d5d14a3e1f2d2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"54779a09a48ecc52c875ed56c5eefd04e083e5d4","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                  *conditions)"},{"line_number":93,"context_line":"        return conditions"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _network_result_filter_hook(self, query, filters):"},{"line_number":96,"context_line":"        vals \u003d filters and filters.get(\u0027router:external\u0027, [])"},{"line_number":97,"context_line":"        if not vals:"},{"line_number":98,"context_line":"            return query"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2BkUc%3D","line":95,"in_reply_to":"AAAAM3%2F%2Bka0%3D","updated":"2013-02-27 04:55:15.000000000","message":"This hook need params \u0027filters\u0027, we can\u0027t change the params of \u0027_network_filter_hook\u0027, that should keep compatibility.","commit_id":"0156ec175cc047826b211727d43d5d14a3e1f2d2"}]}
