)]}'
{"etc/glance-search.conf":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"41a612c348866ed244d173828f45363c9fb7381d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"9a80dd14_e11741ec","updated":"2015-03-07 21:28:47.000000000","message":"If I remember correctly (from one of the previous times I reviewed this), the graffiti server is using glance\u0027s policy.json (to some degree). Does there need to be a policy section here?\n\nEspecially if this is deployed on a separate node from glance-api, glance-registry, or glance-scrubber, you\u0027ll likely need a way to find the policy file in order to enforce it.\n\nPlease also note the existence of https://review.openstack.org/#/c/162368/","commit_id":"8c16f9ffa29f7c0f8187efa666fbb2deed28f66e"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"f74d9ff2bcd75745d0bb68fd5c2db0107045dea4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":31,"id":"9a80dd14_16a44f49","in_reply_to":"9a80dd14_e11741ec","updated":"2015-03-10 11:43:55.000000000","message":"graffiti doesnt have to depend to glance policy.json file, so I have seperated the graffiti rules to another file (search-policy.json).\n\nThanks for comment on entries in policy section - I have included that  now in glance-search.conf with default value for policy file as search-policy.json which could be on a totally seperate node from glance-x services.","commit_id":"8c16f9ffa29f7c0f8187efa666fbb2deed28f66e"}],"glance/api/v2/search.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"057ed46f7aa5a312da63786acfc89704f5780f1e","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from elasticsearch import Elasticsearch"},{"line_number":19,"context_line":"from elasticsearch import helpers"},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"import six"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_4449f9b5","line":18,"updated":"2015-01-27 16:27:48.000000000","message":"Shouldn\u0027t this just be import elasticsearch and then on L58 es_client \u003d elasticsearch.Elasticsearch() ?","commit_id":"5d0d71ce3f2a2b6014fad566ae8c350a1595947d"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"057ed46f7aa5a312da63786acfc89704f5780f1e","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from elasticsearch import Elasticsearch"},{"line_number":19,"context_line":"from elasticsearch import helpers"},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import webob.exc"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_a4cffd27","line":20,"updated":"2015-01-27 16:27:48.000000000","message":"If you remove the definition of CONF, you can remove this too.","commit_id":"5d0d71ce3f2a2b6014fad566ae8c350a1595947d"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"057ed46f7aa5a312da63786acfc89704f5780f1e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"import glance.db"},{"line_number":29,"context_line":"import glance.gateway"},{"line_number":30,"context_line":"from glance import i18n"},{"line_number":31,"context_line":"import glance.notifier"},{"line_number":32,"context_line":"import glance.openstack.common.log as logging"},{"line_number":33,"context_line":"import glance.schema"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_849cc110","line":31,"updated":"2015-01-27 16:27:48.000000000","message":"This seems unused.","commit_id":"5d0d71ce3f2a2b6014fad566ae8c350a1595947d"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"057ed46f7aa5a312da63786acfc89704f5780f1e","unresolved":false,"context_lines":[{"line_number":38,"context_line":"_LW \u003d i18n._LW"},{"line_number":39,"context_line":"_LI \u003d i18n._LI"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"CONF \u003d cfg.CONF"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class SearchController(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_6462753f","line":41,"updated":"2015-01-27 16:27:48.000000000","message":"This doesn\u0027t seem to be used.","commit_id":"5d0d71ce3f2a2b6014fad566ae8c350a1595947d"}],"glance/cmd/index.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"aa49e60789afc5a23a4d36b2d29552679c30cf27","unresolved":false,"context_lines":[{"line_number":30,"context_line":"def main():"},{"line_number":31,"context_line":"    try:"},{"line_number":32,"context_line":"        cfg_files \u003d cfg.find_config_files(project\u003d\u0027glance\u0027,"},{"line_number":33,"context_line":"                                          prog\u003d\u0027glance-api\u0027)"},{"line_number":34,"context_line":"        config.parse_args(default_config_files\u003dcfg_files)"},{"line_number":35,"context_line":"        log.setup(\u0027glance\u0027)"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_20323310","line":33,"updated":"2015-03-03 16:09:00.000000000","message":"Should this be prog\u003d\u0027glance-search\u0027?","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"}],"glance/cmd/search.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from glance.common import utils"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# Monkey patch socket, time, select, threads"},{"line_number":32,"context_line":"eventlet.patcher.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue,"},{"line_number":33,"context_line":"                              select\u003dTrue, thread\u003dTrue, os\u003dTrue)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# If ../glance/__init__.py exists, add ../ to Python search path, so that"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_b9f7e0d3","line":32,"updated":"2015-02-27 02:08:22.000000000","message":"`all\u003dFalse` is implied by the fact that you\u0027re specifying each of the other options. You do not need to specify all\u003dFalse","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from glance.common import utils"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# Monkey patch socket, time, select, threads"},{"line_number":32,"context_line":"eventlet.patcher.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue,"},{"line_number":33,"context_line":"                              select\u003dTrue, thread\u003dTrue, os\u003dTrue)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# If ../glance/__init__.py exists, add ../ to Python search path, so that"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_3b42af10","line":32,"in_reply_to":"ba7be1f8_b9f7e0d3","updated":"2015-03-02 11:48:15.000000000","message":"Done","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"}],"glance/search/__init__.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"5a0ca192881f99aab09c9d4ecee962ac082f2f99","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"def get_api():"},{"line_number":21,"context_line":"        es_api \u003d Elasticsearch()"},{"line_number":22,"context_line":"        return es_api"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_627d3cb2","line":21,"updated":"2015-02-17 20:13:39.000000000","message":"Need to add config options (particularly to assist testing if elasticsearch needs to be started on a non-standard port)","commit_id":"9260dd2aeae92c263d3081074ed0bf92ee92d1af"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"9a1159f13f21edff08c904422f05159a0ba15379","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"def get_api():"},{"line_number":21,"context_line":"        es_api \u003d Elasticsearch()"},{"line_number":22,"context_line":"        return es_api"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_8425c5c3","line":21,"in_reply_to":"da86d52c_627d3cb2","updated":"2015-02-18 10:40:32.000000000","message":"I\u0027ve added elasticsearch_hosts config here.","commit_id":"9260dd2aeae92c263d3081074ed0bf92ee92d1af"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"193e74884c3665daa9d98509f2856aff74249014","unresolved":false,"context_lines":[{"line_number":24,"context_line":"                     \u0027A single node should be defined as an IP address and\u0027"},{"line_number":25,"context_line":"                     \u0027port number.\u0027),"},{"line_number":26,"context_line":"]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"CONF.register_opts(search_opts)"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"da86d52c_037c581f","line":27,"updated":"2015-02-18 17:32:41.000000000","message":"Doesn\u0027t this need a group to match the sample conf?","commit_id":"7e37281503808ac1b6d7b55342038b108ef56a39"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"01eda3d0865e4035d21a7bc11c8a8153d521cf5a","unresolved":false,"context_lines":[{"line_number":26,"context_line":"]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"CONF.register_opts(search_opts)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def get_api():"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba7be1f8_59f961e8","line":29,"updated":"2015-02-20 23:11:38.000000000","message":"This needs to be in a group \u0027elasticsearch\u0027 to match the sample config file","commit_id":"e7740a4fa721ecb9e1fe9cf1217deddff684f73e"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"3fa89ebe6bd75c67921e61bdf088026c90fce31d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"CONF.register_opts(search_opts)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def get_api():"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba7be1f8_4c4761bc","line":29,"in_reply_to":"ba7be1f8_59f961e8","updated":"2015-02-25 10:44:40.000000000","message":"Done","commit_id":"e7740a4fa721ecb9e1fe9cf1217deddff684f73e"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ec7df5e26e68b9702ab1fd8a4fdc0d0a913fff1a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from elasticsearch import Elasticsearch"},{"line_number":17,"context_line":"from elasticsearch import helpers"},{"line_number":18,"context_line":"from oslo_config import cfg"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_522016b0","line":16,"updated":"2015-03-02 18:11:24.000000000","message":"Why don\u0027t we import elasticsearch here? Do we have module-only imports disabled in glance?","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"}],"glance/search/api/v2/search.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"36bd1ce16593c88a6eea8a73ee377ba69ba14fb7","unresolved":false,"context_lines":[{"line_number":34,"context_line":"_ \u003d i18n._"},{"line_number":35,"context_line":"_LE \u003d i18n._LE"},{"line_number":36,"context_line":"_LW \u003d i18n._LW"},{"line_number":37,"context_line":"_LI \u003d i18n._LI"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"CONF \u003d cfg.CONF"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_3e1cef12","line":37,"updated":"2015-02-19 13:47:38.000000000","message":"_LE, _LW and _LI are not used anywhere.","commit_id":"cf1474c09d2fbc17119942553d296cb2fd5683c5"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":300,"context_line":"def get_plugins():"},{"line_number":301,"context_line":"        namespace \u003d \u0027glance.search.index_backend\u0027"},{"line_number":302,"context_line":"        ext_manager \u003d stevedore.extension.ExtensionManager("},{"line_number":303,"context_line":"            namespace, invoke_on_load\u003dTrue)"},{"line_number":304,"context_line":"        return ext_manager.extensions"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_19454cb3","line":303,"updated":"2015-02-27 02:08:22.000000000","message":"This looks doubly-indented","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":300,"context_line":"def get_plugins():"},{"line_number":301,"context_line":"        namespace \u003d \u0027glance.search.index_backend\u0027"},{"line_number":302,"context_line":"        ext_manager \u003d stevedore.extension.ExtensionManager("},{"line_number":303,"context_line":"            namespace, invoke_on_load\u003dTrue)"},{"line_number":304,"context_line":"        return ext_manager.extensions"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_fb3737ae","line":303,"in_reply_to":"ba7be1f8_19454cb3","updated":"2015-03-02 11:48:15.000000000","message":"Indeed, done.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0bfc5a6fe16ab90430322f530ba008c0f68a7d99","unresolved":false,"context_lines":[{"line_number":35,"context_line":"_ \u003d i18n._"},{"line_number":36,"context_line":"_LE \u003d i18n._LE"},{"line_number":37,"context_line":"_LW \u003d i18n._LW"},{"line_number":38,"context_line":"_LI \u003d i18n._LI"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"CONF \u003d cfg.CONF"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_39e0c9f9","line":38,"updated":"2015-03-03 06:54:26.000000000","message":"_LW and _LI is unused.","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"485aabed077c9af15711679dbead670d9eb6434c","unresolved":false,"context_lines":[{"line_number":35,"context_line":"_ \u003d i18n._"},{"line_number":36,"context_line":"_LE \u003d i18n._LE"},{"line_number":37,"context_line":"_LW \u003d i18n._LW"},{"line_number":38,"context_line":"_LI \u003d i18n._LI"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"CONF \u003d cfg.CONF"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9a80dd14_141dbe73","line":38,"in_reply_to":"ba7be1f8_39e0c9f9","updated":"2015-03-05 20:08:36.000000000","message":"Done","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ec7df5e26e68b9702ab1fd8a4fdc0d0a913fff1a","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            output.append(bulk_action)"},{"line_number":182,"context_line":"        return output"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def search(self, request):"},{"line_number":185,"context_line":"        body \u003d self._get_request_body(request)"},{"line_number":186,"context_line":"        self._check_allowed(body)"},{"line_number":187,"context_line":"        query \u003d body.pop(\u0027query\u0027, None)"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_13b860e4","line":184,"updated":"2015-03-02 18:11:24.000000000","message":"This method is pretty large (94 lines long). Is there a chance we could break it out into smaller (private) methods to make it easier to consume?","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"485aabed077c9af15711679dbead670d9eb6434c","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            output.append(bulk_action)"},{"line_number":182,"context_line":"        return output"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def search(self, request):"},{"line_number":185,"context_line":"        body \u003d self._get_request_body(request)"},{"line_number":186,"context_line":"        self._check_allowed(body)"},{"line_number":187,"context_line":"        query \u003d body.pop(\u0027query\u0027, None)"}],"source_content_type":"text/x-python","patch_set":26,"id":"9a80dd14_3414824d","line":184,"in_reply_to":"ba7be1f8_13b860e4","updated":"2015-03-05 20:08:36.000000000","message":"Done","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"}],"glance/search/images/models.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"057ed46f7aa5a312da63786acfc89704f5780f1e","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    def get_mapping(cls):"},{"line_number":24,"context_line":"        mapping \u003d {"},{"line_number":25,"context_line":"            \u0027dynamic\u0027: True,"},{"line_number":26,"context_line":"            \u0027properties\u0027: {"},{"line_number":27,"context_line":"                \u0027id\u0027: {\u0027type\u0027: \u0027string\u0027},"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_5f84605d","line":24,"updated":"2015-01-27 16:27:48.000000000","message":"Why not return the dictionary directly?","commit_id":"5d0d71ce3f2a2b6014fad566ae8c350a1595947d"}],"glance/search/plugins/base.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"8c20a8b979deb6a73e9d15fc42f8087d6d80869d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.index_name \u003d self.get_index_name()"},{"line_number":31,"context_line":"        self.document_type \u003d self.get_document_type()"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def setup(self):"},{"line_number":34,"context_line":"        \"\"\"Comprehensively install search engine index and put data into it.\"\"\""},{"line_number":35,"context_line":"        self.setup_index()"},{"line_number":36,"context_line":"        self.setup_mapping()"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_46d8201e","line":33,"updated":"2015-03-03 16:19:57.000000000","message":"Currently this is additive (e.g. if there\u0027s already an index and data in it, it will add to it). Should there be an option to re-index (for instance if source data\u0027s been deleted)? \n\nThis is a worse problem in a case where a plugin doesn\u0027t define an id field (and elasticsearch generates ids), as the result would be duplicate data. Perhaps we should enforce an id field in the contract of this base class? It\u0027s hard to think of any openstack resource that wouldn\u0027t already have an ID that could be used.","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"}],"glance/search/plugins/metadefs.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def get_rbac_filter(self, request_context):"},{"line_number":81,"context_line":"        return {"},{"line_number":82,"context_line":"            \u0027or\u0027: ["},{"line_number":83,"context_line":"                {"},{"line_number":84,"context_line":"                    \u0027term\u0027: {"},{"line_number":85,"context_line":"                        \u0027owner\u0027: request_context.owner"},{"line_number":86,"context_line":"                    }"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_74c9edab","line":83,"updated":"2015-02-27 02:08:22.000000000","message":"There seems to be some common pieces between the get_rbac_filter methods. Would it be possible to have base.IndexBase.get_rbac_filter define the common subset of query pieces (for lack of a better term) that you then include in the \u0027or\u0027 list? Something like\n\n    def get_common_context_pieces(self, request_context):\n        return [{\u0027term\u0027: {\u0027owner\u0027: request_context.owner,\n                          \u0027type\u0027: {\u0027value\u0027: self.get_document_type()}}]\n\nIt would prevent a lot of copy-paste and then updates in multiple places. Especially since this relates to the security of the application, it\u0027d be nice to have to update as few as possibles for common details.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def get_rbac_filter(self, request_context):"},{"line_number":81,"context_line":"        return {"},{"line_number":82,"context_line":"            \u0027or\u0027: ["},{"line_number":83,"context_line":"                {"},{"line_number":84,"context_line":"                    \u0027term\u0027: {"},{"line_number":85,"context_line":"                        \u0027owner\u0027: request_context.owner"},{"line_number":86,"context_line":"                    }"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_e18ea8cf","line":83,"in_reply_to":"ba7be1f8_74c9edab","updated":"2015-03-02 11:48:15.000000000","message":"I\u0027ve added a TODO to this method so we won\u0027t forget about this suggestion. Will handle it as soon as possible.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        resource_types \u003d session.query(models.MetadefResourceType).all()"},{"line_number":106,"context_line":"        resource_types_map \u003d {}"},{"line_number":107,"context_line":"        for resource_type in resource_types:"},{"line_number":108,"context_line":"            resource_types_map[resource_type.id] \u003d resource_type.name"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        for namespace in namespaces:"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_1468b186","line":107,"updated":"2015-02-27 02:08:22.000000000","message":"Wouldn\u0027t a dictionary comprehension be faster here? For example,\n\n     resource_types_map \u003d {r.id: r.name for r in resource_types}","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        resource_types \u003d session.query(models.MetadefResourceType).all()"},{"line_number":106,"context_line":"        resource_types_map \u003d {}"},{"line_number":107,"context_line":"        for resource_type in resource_types:"},{"line_number":108,"context_line":"            resource_types_map[resource_type.id] \u003d resource_type.name"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        for namespace in namespaces:"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_1b9fabb5","line":107,"in_reply_to":"ba7be1f8_1468b186","updated":"2015-03-02 11:48:15.000000000","message":"Done","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def serialize(self, obj):"},{"line_number":146,"context_line":"        object_docs \u003d []"},{"line_number":147,"context_line":"        for ns_obj in obj.objects:"},{"line_number":148,"context_line":"            obj_doc \u003d self.serialize_object(ns_obj)"},{"line_number":149,"context_line":"            object_docs.append(obj_doc)"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_34d21535","line":147,"updated":"2015-02-27 02:08:22.000000000","message":"List comprehensions will be faster here, especially if we avoid an attribute look up each time through a loop, e.g.,\n\n    serialize \u003d self.serialize_object\n    object_docs \u003d [serialize(ns_obj) for ns_obj in obj.objects]","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def serialize(self, obj):"},{"line_number":146,"context_line":"        object_docs \u003d []"},{"line_number":147,"context_line":"        for ns_obj in obj.objects:"},{"line_number":148,"context_line":"            obj_doc \u003d self.serialize_object(ns_obj)"},{"line_number":149,"context_line":"            object_docs.append(obj_doc)"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_bbe77f3f","line":147,"in_reply_to":"ba7be1f8_34d21535","updated":"2015-03-02 11:48:15.000000000","message":"Done","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            object_docs.append(obj_doc)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        property_docs \u003d []"},{"line_number":152,"context_line":"        for ns_property in obj.properties:"},{"line_number":153,"context_line":"            property_doc \u003d self.serialize_property("},{"line_number":154,"context_line":"                ns_property.name, ns_property.json_schema)"},{"line_number":155,"context_line":"            property_docs.append(property_doc)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_94b821e7","line":152,"updated":"2015-02-27 02:08:22.000000000","message":"We can do the same here:\n\n    serialize \u003d self.serialize_property\n    property_docs \u003d [serialize(ns.name, ns.json_schema)\n                     for ns in obj.properties]","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"695676f784fb2032269f28603b5fbeb57f0b911d","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            object_docs.append(obj_doc)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        property_docs \u003d []"},{"line_number":152,"context_line":"        for ns_property in obj.properties:"},{"line_number":153,"context_line":"            property_doc \u003d self.serialize_property("},{"line_number":154,"context_line":"                ns_property.name, ns_property.json_schema)"},{"line_number":155,"context_line":"            property_docs.append(property_doc)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_fbd01755","line":152,"in_reply_to":"ba7be1f8_94b821e7","updated":"2015-03-02 11:48:15.000000000","message":"Done","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"dd04653195f14af1a511c0c9a49c52f3666ab4da","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    def serialize(self, obj):"},{"line_number":150,"context_line":"        object_docs \u003d [self.serialize_object(ns_obj) for ns_obj in obj.objects]"},{"line_number":151,"context_line":"        property_docs \u003d [self.serialize_property(prop.name, prop.json_schema)"},{"line_number":152,"context_line":"                         for prop in obj.properties]"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        namespace_doc \u003d self.serialize_namespace(obj)"},{"line_number":155,"context_line":"        namespace_doc.update({"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_b75e7643","line":152,"updated":"2015-03-03 12:07:55.000000000","message":"resource_associations are not being serialized","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"41a612c348866ed244d173828f45363c9fb7381d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        return mapping"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def get_rbac_filter(self, request_context):"},{"line_number":87,"context_line":"        # TODO(krykowski): Define base get_rbac_filter in IndexBase class"},{"line_number":88,"context_line":"        # which will provide some common subset of query pieces."},{"line_number":89,"context_line":"        # Something like:"},{"line_number":90,"context_line":"        # def get_common_context_pieces(self, request_context):"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_81ae8596","line":87,"updated":"2015-03-07 21:28:47.000000000","message":"+1 Thanks for adding this.","commit_id":"8c16f9ffa29f7c0f8187efa666fbb2deed28f66e"}],"glance/tests/unit/test_search.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ec7df5e26e68b9702ab1fd8a4fdc0d0a913fff1a","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        \u0027updated_at\u0027: DATETIME,"},{"line_number":90,"context_line":"    }"},{"line_number":91,"context_line":"    obj.update(kwargs)"},{"line_number":92,"context_line":"    image \u003d DictObj(**obj)"},{"line_number":93,"context_line":"    image.tags \u003d set(image.tags)"},{"line_number":94,"context_line":"    image.properties \u003d [DictObj(name\u003dk, value\u003dv)"},{"line_number":95,"context_line":"                        for k, v in extra_properties.items()]"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_19a31e9f","line":92,"updated":"2015-03-02 18:11:24.000000000","message":"This could just as easily be \n\n    mock.Mock(**obj)\n\nNo need to make a DictObj class, and if you want to disallow other methods, simply use the ability to do\n\n    mock.Mock(spec_set\u003dlist(obj.keys()), **keys)","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"ec7df5e26e68b9702ab1fd8a4fdc0d0a913fff1a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        \u0027owner\u0027: None"},{"line_number":108,"context_line":"    }"},{"line_number":109,"context_line":"    obj.update(kwargs)"},{"line_number":110,"context_line":"    return DictObj(**obj)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"def _db_property_fixture(name, **kwargs):"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_99dd4e17","line":110,"updated":"2015-03-02 18:11:24.000000000","message":"Could just as easily be mock.Mock here and below too.","commit_id":"95d6270d49866b7cc2daadbcab0afe6a246cfb09"}],"glance/tests/unit/v2/test_search.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"f16c8ff7bc17c3f1dd64f9d26af575ab9fe883ab","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        offset \u003d 0"},{"line_number":59,"context_line":"        limit \u003d 10"},{"line_number":60,"context_line":"        multi_type \u003d False"},{"line_number":61,"context_line":"        self.search_controller.search("},{"line_number":62,"context_line":"            request, query, index, doc_type, fields, offset, limit,"},{"line_number":63,"context_line":"            multi_type)"},{"line_number":64,"context_line":"        repo.search.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_e21b6a71","line":61,"updated":"2015-02-26 21:34:28.000000000","message":"This may be the case for an admin user, but for a non-admin user it will be much more complicated since all the RBAC filters will be applied to the query.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":10383,"name":"Wayne Okuma","email":"wayne.okuma@hpe.com","username":"okumaw"},"change_message_id":"17d14ccb2e94c3d2ccff2c85d180bb27fc3725dc","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        offset \u003d 0"},{"line_number":59,"context_line":"        limit \u003d 10"},{"line_number":60,"context_line":"        multi_type \u003d False"},{"line_number":61,"context_line":"        self.search_controller.search("},{"line_number":62,"context_line":"            request, query, index, doc_type, fields, offset, limit,"},{"line_number":63,"context_line":"            multi_type)"},{"line_number":64,"context_line":"        repo.search.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":24,"id":"9a80dd14_7e2527c1","line":61,"in_reply_to":"ba7be1f8_14c4315e","updated":"2015-03-05 03:41:15.000000000","message":"To test the admin/non-admin unit tests, i added a TestRequestDeserializer class in Patch 27. It tests the RequestDeserializer.search and index methods. Also, added SearchController.index testing.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"9a1fa04d92c05183f6026d7c1c78b535b5d0d12e","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        offset \u003d 0"},{"line_number":59,"context_line":"        limit \u003d 10"},{"line_number":60,"context_line":"        multi_type \u003d False"},{"line_number":61,"context_line":"        self.search_controller.search("},{"line_number":62,"context_line":"            request, query, index, doc_type, fields, offset, limit,"},{"line_number":63,"context_line":"            multi_type)"},{"line_number":64,"context_line":"        repo.search.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":24,"id":"ba7be1f8_14c4315e","line":61,"in_reply_to":"ba7be1f8_e21b6a71","updated":"2015-02-27 02:08:22.000000000","message":"+1 More tests would be good.","commit_id":"e7e350c34bda957b4b2bce6ebc780d8420c7a8de"}],"requirements.txt":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"6748bbeedfcdbd621dc867fe8c589916eada1c3a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"glance_store\u003e\u003d0.1.10                   # Apache-2.0"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Glance catalog index"},{"line_number":65,"context_line":"elasticsearch\u003e\u003d1.2.0"}],"source_content_type":"text/plain","patch_set":6,"id":"1a930d6b_71992c78","line":65,"updated":"2015-01-27 16:27:58.000000000","message":"Needs to be \u003e\u003d 1.3.0","commit_id":"dd305b99e6eb13de95e0308ec27be6f181d05231"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"f2a9af5827e0259f95a9a33513cb178bbfd9161e","unresolved":false,"context_lines":[{"line_number":62,"context_line":"glance_store\u003e\u003d0.1.10                   # Apache-2.0"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"# Glance catalog index"},{"line_number":65,"context_line":"elasticsearch\u003e\u003d1.2.0"}],"source_content_type":"text/plain","patch_set":6,"id":"da86d52c_b130bf57","line":65,"in_reply_to":"1a930d6b_71992c78","updated":"2015-02-02 10:26:18.000000000","message":"Done. Matches with global requirements which got merged recently.","commit_id":"dd305b99e6eb13de95e0308ec27be6f181d05231"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"d68db0faa8f8b268723768669d17fd75d3d00357","unresolved":false,"context_lines":[{"line_number":63,"context_line":"glance_store\u003e\u003d0.3.0                   # Apache-2.0"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"# Glance catalog index"},{"line_number":66,"context_line":"elasticsearch\u003e\u003d1.3.0"}],"source_content_type":"text/plain","patch_set":47,"id":"9aa53dc9_2f945e89","line":66,"range":{"start_line":66,"start_character":19,"end_line":66,"end_character":20},"updated":"2015-04-07 16:00:56.000000000","message":"This should have been added to test-requirements.txt not requirements.txt since this is an optional feature.","commit_id":"9911f962a44cf3b4e985a9f28e7b9dea2f7cadb1"}]}
