)]}'
{"mistral/actions/openstack/actions.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"bbc4660c9137cdc84a333cccc7d205e4be0c76c8","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def _get_client(self):"},{"line_number":62,"context_line":"        ctx \u003d context.ctx()"},{"line_number":63,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":64,"context_line":"        if self._check_client_cache(clientname):"},{"line_number":65,"context_line":"            return self._clients[clientname].client"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        LOG.debug(\"Nova action security context: %s\" % ctx)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_271b0ecc","line":64,"range":{"start_line":64,"start_character":11,"end_line":64,"end_character":15},"updated":"2016-07-15 10:52:01.000000000","message":"Soft: we usually insert a blank line before if, for, try, return (if there isn\u0027t \"if\" right before it), with.","commit_id":"9f87ea5247ec1902a3f1ce481c24bc3bc94d859a"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"bbc4660c9137cdc84a333cccc7d205e4be0c76c8","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        return glanceclient.Client"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def _get_client(self):"},{"line_number":104,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":105,"context_line":"        if self._check_client_cache(clientname):"},{"line_number":106,"context_line":"            return self._clients[clientname].client"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        ctx \u003d context.ctx()"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_27f78e5a","line":106,"range":{"start_line":104,"start_character":8,"end_line":106,"end_character":51},"updated":"2016-07-15 10:52:01.000000000","message":"This code snippet is repeated over and over again. Can we avoid duplication?\n\nLooks like we can split the whole logic into methods:\n\n* _get_client() that checks cache and if client is not present it creates it with a different method _create_client()\n* _create_client() that really creates a client (always)\n\nSo all common logic will be encapsulated within the first one and action type specific within the second one. The point I\u0027m making is: let\u0027s make this caching behavior transparent for specific action classes.\n\nAnother concern: will it be working fine with multiple threads? (sorry, I\u0027m not a great expert in Python concurrency)","commit_id":"9f87ea5247ec1902a3f1ce481c24bc3bc94d859a"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"66dc1a3e2306f32daaaa7df2223c55a4b08d60f6","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        return glanceclient.Client"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def _get_client(self):"},{"line_number":104,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":105,"context_line":"        if self._check_client_cache(clientname):"},{"line_number":106,"context_line":"            return self._clients[clientname].client"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        ctx \u003d context.ctx()"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fad55976_761a3570","line":106,"range":{"start_line":104,"start_character":8,"end_line":106,"end_character":51},"in_reply_to":"1aa78d24_27f78e5a","updated":"2016-07-15 19:19:09.000000000","message":"I can refactor as you\u0027ve suggested. I\u0027ll try to reduce the duplication further, but there\u0027s going to have to be some modification to each action to identify the name of a given action at a minimum (unless I\u0027m missing something).\n\nI have a follow up patch (still WIP) that implements a new API call for third party actions. It illustrates how creating third party actions can simply call get_client(\u0027heat\u0027) and all the caching will be handled internally.\n\nIs the executor using green threads? If so, no locking should be required. But I\u0027ll need to look into this further.","commit_id":"9f87ea5247ec1902a3f1ce481c24bc3bc94d859a"}],"mistral/actions/openstack/base.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"4bbe1df43ae9ac3fd263333fd4da7b4b771b642b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        (e.g. Nova, Glance, Heat, Keystone etc)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        def create_client_cache():"},{"line_number":91,"context_line":"            ctx \u003d context.ctx()"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_59e27d30","line":88,"range":{"start_line":88,"start_character":8,"end_line":88,"end_character":18},"updated":"2016-07-25 11:21:36.000000000","message":"Variable names should be written using lower_case_with_underscores[1]. Please fix this in all files.\n\n[1] https://www.python.org/dev/peps/pep-0008/#method-names-and-instance-variables","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        (e.g. Nova, Glance, Heat, Keystone etc)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        def create_client_cache():"},{"line_number":91,"context_line":"            ctx \u003d context.ctx()"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_64317a0b","line":88,"range":{"start_line":88,"start_character":8,"end_line":88,"end_character":18},"in_reply_to":"dada55a8_59e27d30","updated":"2016-07-25 20:35:20.000000000","message":"replaced with client_name, didn\u0027t see any other references outside of this file","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"7edccefb4d736fe28aca88e2666ab831073a1954","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        def create_client_cache():"},{"line_number":91,"context_line":"            ctx \u003d context.ctx()"},{"line_number":92,"context_line":"            newclient \u003d self._create_client()"},{"line_number":93,"context_line":"            self._clients[clientname] \u003d ClientWrapper(newclient,"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_88582158","line":90,"range":{"start_line":90,"start_character":12,"end_line":90,"end_character":31},"updated":"2016-07-25 09:50:05.000000000","message":"I\u0027m slightly confused about the method name. Usually by \"cache\" we mean a structure that stores value under some keys, essentially key-value storage. Or by \"cache\" we mean operation \"put a value Y under key X into the cache\". This method actually creates a client and caches it. Hence, I\u0027d suggest we call this method something like \"create_and_cache_client\" or \"create_cached_client\".","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"4bbe1df43ae9ac3fd263333fd4da7b4b771b642b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        def create_client_cache():"},{"line_number":91,"context_line":"            ctx \u003d context.ctx()"},{"line_number":92,"context_line":"            newclient \u003d self._create_client()"},{"line_number":93,"context_line":"            self._clients[clientname] \u003d ClientWrapper(newclient,"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_9907d5c8","line":90,"range":{"start_line":90,"start_character":12,"end_line":90,"end_character":31},"in_reply_to":"dada55a8_88582158","updated":"2016-07-25 11:21:36.000000000","message":"I agree with Renat - \"create_cached_client\" seems to be a better name.","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        clientname \u003d self.__class__.__name__.strip(\u0027Action\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        def create_client_cache():"},{"line_number":91,"context_line":"            ctx \u003d context.ctx()"},{"line_number":92,"context_line":"            newclient \u003d self._create_client()"},{"line_number":93,"context_line":"            self._clients[clientname] \u003d ClientWrapper(newclient,"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_8f09272f","line":90,"range":{"start_line":90,"start_character":12,"end_line":90,"end_character":31},"in_reply_to":"dada55a8_9907d5c8","updated":"2016-07-25 20:35:20.000000000","message":"renamed to create_cached_client","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"7edccefb4d736fe28aca88e2666ab831073a1954","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        if clientname not in self._clients:"},{"line_number":98,"context_line":"            return create_client_cache()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        wrapped_client \u003d self._clients[clientname]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        if keystone_utils.will_expire_soon(wrapped_client.expires_at):"},{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_b3811a50","line":100,"range":{"start_line":100,"start_character":8,"end_line":100,"end_character":50},"updated":"2016-07-25 09:50:05.000000000","message":"I suggest a performance optimization. Now we do dict search by key twice, on line 97 and 100. It can be done once just by moving 100 before 97 and checking in 97 if wrapped_client is None. If it\u0027s not, then you can reuse it.","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        if clientname not in self._clients:"},{"line_number":98,"context_line":"            return create_client_cache()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        wrapped_client \u003d self._clients[clientname]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        if keystone_utils.will_expire_soon(wrapped_client.expires_at):"},{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_6f295337","line":100,"range":{"start_line":100,"start_character":8,"end_line":100,"end_character":50},"in_reply_to":"dada55a8_b3811a50","updated":"2016-07-25 20:35:20.000000000","message":"Good call","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"7edccefb4d736fe28aca88e2666ab831073a1954","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        wrapped_client \u003d self._clients[clientname]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        if keystone_utils.will_expire_soon(wrapped_client.expires_at):"},{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"},{"line_number":104,"context_line":"            return create_client_cache()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_d3f5aeed","line":103,"range":{"start_line":103,"start_character":12,"end_line":103,"end_character":15},"updated":"2016-07-25 09:50:05.000000000","message":"Soft: I suggest we insert a blank line after logging statement.","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        wrapped_client \u003d self._clients[clientname]"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        if keystone_utils.will_expire_soon(wrapped_client.expires_at):"},{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"},{"line_number":104,"context_line":"            return create_client_cache()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_2fd63b27","line":103,"range":{"start_line":103,"start_character":12,"end_line":103,"end_character":15},"in_reply_to":"dada55a8_d3f5aeed","updated":"2016-07-25 20:35:20.000000000","message":"Done","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"7edccefb4d736fe28aca88e2666ab831073a1954","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"},{"line_number":104,"context_line":"            return create_client_cache()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"},{"line_number":107,"context_line":"        return wrapped_client.client"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def run(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_73e7a240","line":106,"range":{"start_line":106,"start_character":12,"end_line":106,"end_character":17},"updated":"2016-07-25 09:50:05.000000000","message":"Soft: I suggest we insert a blank line after logging statement.","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"},{"line_number":104,"context_line":"            return create_client_cache()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"},{"line_number":107,"context_line":"        return wrapped_client.client"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def run(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_8fdda744","line":106,"range":{"start_line":106,"start_character":12,"end_line":106,"end_character":17},"in_reply_to":"dada55a8_73e7a240","updated":"2016-07-25 20:35:20.000000000","message":"Done","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"f33d370e515aa06b8c88305113d6ad889af619f0","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            return new_client"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        project_clients \u003d self._clients.get(client_name)"},{"line_number":110,"context_line":"        if project_clients:"},{"line_number":111,"context_line":"            wrapped_client \u003d project_clients.get(ctx.project_name)"},{"line_number":112,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7a5afa84","line":109,"range":{"start_line":109,"start_character":8,"end_line":109,"end_character":55},"updated":"2016-07-28 09:20:57.000000000","message":"The client is only recognized by its name (e.g. Nova), therefore it can be used by user with different permissions than the one the client was created with (admin vs no-admin).","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"36a5cccdd9e8d8118df83204cbd8e07dfe11b415","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            return new_client"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        project_clients \u003d self._clients.get(client_name)"},{"line_number":110,"context_line":"        if project_clients:"},{"line_number":111,"context_line":"            wrapped_client \u003d project_clients.get(ctx.project_name)"},{"line_number":112,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_ccab38d5","line":109,"range":{"start_line":109,"start_character":8,"end_line":109,"end_character":55},"in_reply_to":"bacf61ea_51b5342f","updated":"2016-07-29 08:27:11.000000000","message":"You are right. Sorry about that.","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"943ca01d02c088857186c7ecabe3701aaf847723","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            return new_client"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        project_clients \u003d self._clients.get(client_name)"},{"line_number":110,"context_line":"        if project_clients:"},{"line_number":111,"context_line":"            wrapped_client \u003d project_clients.get(ctx.project_name)"},{"line_number":112,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_51b5342f","line":109,"range":{"start_line":109,"start_character":8,"end_line":109,"end_character":55},"in_reply_to":"bacf61ea_7a5afa84","updated":"2016-07-28 21:25:59.000000000","message":"This is just the first check to see if a client has previously been cached. If so, the lines below are checking the project/tenant name.","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"68407d65a028fe325e77b25ca97abafb5a1ef3e3","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            self._clients[key] \u003d new_client"},{"line_number":96,"context_line":"            return new_client"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with self._lock:"},{"line_number":99,"context_line":"            client \u003d self._clients.get(key)"},{"line_number":100,"context_line":"            if client is None:"},{"line_number":101,"context_line":"                return create_cached_client()"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_e2eb1a11","line":98,"range":{"start_line":98,"start_character":8,"end_line":98,"end_character":24},"updated":"2016-08-12 03:59:20.000000000","message":"I think lock scope is incorrect. It should be applied only for accessing the cache. No matter if it\u0027s write or read. For example, when we are writing a value into cache  we should not be reading the cache because not all internal structures may be ready 100%, the operation may not be atomic. Hence read won\u0027t be valid. \n\nAs far as duration of blocking code the principle is usual for such cases: any blocking code should be as short as possible.","commit_id":"fd5388571f97186a9f4bc7408d4fb685da98d7da"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"b978d47772f2112517a6997d7b7e9a4e980c6a62","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            self._clients[key] \u003d new_client"},{"line_number":96,"context_line":"            return new_client"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with self._lock:"},{"line_number":99,"context_line":"            client \u003d self._clients.get(key)"},{"line_number":100,"context_line":"            if client is None:"},{"line_number":101,"context_line":"                return create_cached_client()"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_51e60de9","line":98,"range":{"start_line":98,"start_character":8,"end_line":98,"end_character":24},"in_reply_to":"9ad45d7e_960b5b2b","updated":"2016-08-12 16:29:21.000000000","message":"Also going to change self._lock to just Lock, since the same thread shouldn\u0027t need to reacquire the lock.","commit_id":"fd5388571f97186a9f4bc7408d4fb685da98d7da"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"3d4880faa7ba9f991be276f3fc53795081c87eb8","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            self._clients[key] \u003d new_client"},{"line_number":96,"context_line":"            return new_client"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with self._lock:"},{"line_number":99,"context_line":"            client \u003d self._clients.get(key)"},{"line_number":100,"context_line":"            if client is None:"},{"line_number":101,"context_line":"                return create_cached_client()"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_960b5b2b","line":98,"range":{"start_line":98,"start_character":8,"end_line":98,"end_character":24},"in_reply_to":"9ad45d7e_e2eb1a11","updated":"2016-08-12 16:12:30.000000000","message":"I\u0027ll modify the locking to only occur on the the write (line 95) and the read (line 99). Hopefully that\u0027s all you\u0027re asking for here.","commit_id":"fd5388571f97186a9f4bc7408d4fb685da98d7da"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"50d4fe7641b9f42fa2f8033f7a8bba72ccadbf13","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            new_client._mistral_ctx_expires_at \u003d ctx.expires_at"},{"line_number":95,"context_line":"            with self._lock:"},{"line_number":96,"context_line":"                self._clients[key] \u003d new_client"},{"line_number":97,"context_line":"            return new_client"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        with self._lock:"},{"line_number":100,"context_line":"            client \u003d self._clients.get(key)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_643ce9e2","line":97,"updated":"2016-08-29 08:59:57.000000000","message":"Soft: insert blank line before 97 and 95.","commit_id":"d585dcb9523e9f7c40ce4ddb07569456f00e556b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"50d4fe7641b9f42fa2f8033f7a8bba72ccadbf13","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        if keystone_utils.will_expire_soon(client._mistral_ctx_expires_at):"},{"line_number":106,"context_line":"            LOG.debug(\"cache expiring soon, will refresh client\")"},{"line_number":107,"context_line":"            return create_cached_client()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"},{"line_number":110,"context_line":"        return client"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_a426f1cb","line":107,"range":{"start_line":107,"start_character":12,"end_line":107,"end_character":18},"updated":"2016-08-29 08:59:57.000000000","message":"Soft: insert blank line before 107.","commit_id":"d585dcb9523e9f7c40ce4ddb07569456f00e556b"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"50d4fe7641b9f42fa2f8033f7a8bba72ccadbf13","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            return create_cached_client()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        LOG.debug(\"cache not expiring soon, will return cached client\")"},{"line_number":110,"context_line":"        return client"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def run(self):"},{"line_number":113,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa7ab95a_c42135b6","line":110,"range":{"start_line":110,"start_character":8,"end_line":110,"end_character":14},"updated":"2016-08-29 08:59:57.000000000","message":"Soft: insert blank line before 110.","commit_id":"d585dcb9523e9f7c40ce4ddb07569456f00e556b"}],"mistral/config.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"bbc4660c9137cdc84a333cccc7d205e4be0c76c8","unresolved":false,"context_lines":[{"line_number":169,"context_line":"             \u0027( SUCCESS / ERROR ).\u0027"},{"line_number":170,"context_line":"    ),"},{"line_number":171,"context_line":"    cfg.IntOpt("},{"line_number":172,"context_line":"        \u0027expiration_token_duration\u0027,"},{"line_number":173,"context_line":"        default\u003d30,"},{"line_number":174,"context_line":"        help\u003d\u0027Window of seconds to determine whether the given token is about\u0027"},{"line_number":175,"context_line":"             \u0027to expire.\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_077c121f","line":172,"range":{"start_line":172,"start_character":9,"end_line":172,"end_character":34},"updated":"2016-07-15 10:52:01.000000000","message":"This property should not be in this group. Execution expiration policy has nothing to do with tokens, it determines when we need to delete an execution object from DB (say, they get deleted automatically if they are 1 month old).","commit_id":"9f87ea5247ec1902a3f1ce481c24bc3bc94d859a"}],"mistral/context.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"41e06249e7b72b4b42204aed0478caaca1ced2f5","unresolved":false,"context_lines":[{"line_number":321,"context_line":""},{"line_number":322,"context_line":"class ContextHook(hooks.PecanHook):"},{"line_number":323,"context_line":"    def before(self, state):"},{"line_number":324,"context_line":"        set_ctx(context_from_headers_and_env(state.request.headers,"},{"line_number":325,"context_line":"                                             state.request.environ))"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def after(self, state):"},{"line_number":328,"context_line":"        set_ctx(None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_2dd2e300","line":325,"range":{"start_line":324,"start_character":0,"end_line":325,"end_character":68},"updated":"2016-08-16 09:40:36.000000000","message":"Soft: should look like:\n\n set_ctx(context_from_headers_and_env(\n     state.request.headers,\n     state.request.environ\n ))","commit_id":"30def2eaab357a5a1a047ec411d8c93b2b1cf628"}],"mistral/tests/unit/actions/openstack/test_openstack_actions.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"f33d370e515aa06b8c88305113d6ad889af619f0","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            project_name\u003d\u0027admin\u0027,"},{"line_number":57,"context_line":"            auth_token\u003dNone,"},{"line_number":58,"context_line":"            is_admin\u003dFalse,"},{"line_number":59,"context_line":"            # set year to 3016 in order for token to always be valid"},{"line_number":60,"context_line":"            expires_at\u003d\u00273016-07-13T18:34:22.000000Z\u0027"},{"line_number":61,"context_line":"        )"},{"line_number":62,"context_line":"        ctx.set_ctx(test_ctx)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_5a7296e6","line":59,"range":{"start_line":59,"start_character":14,"end_line":59,"end_character":68},"updated":"2016-07-28 09:20:57.000000000","message":"Soft: All comments should be complaint with English language (start with capital letter, end with dot).","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"f33d370e515aa06b8c88305113d6ad889af619f0","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        mock_novaclient.Client().servers.get.assert_called_once_with("},{"line_number":120,"context_line":"            server\u003d\"1234-abcd\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # now to test the cache"},{"line_number":123,"context_line":"        mock_novaclient.reset_mock()"},{"line_number":124,"context_line":"        action.run()"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_da9046ef","line":122,"range":{"start_line":122,"start_character":9,"end_line":122,"end_character":31},"updated":"2016-07-28 09:20:57.000000000","message":"I don\u0027t understand what this comments means (especially the word \u0027now\u0027 in this context). Please rephrase it.\n\nSoft: All comments should be complaint with English language (start with capital letter, end with dot).","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"943ca01d02c088857186c7ecabe3701aaf847723","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        mock_novaclient.Client().servers.get.assert_called_once_with("},{"line_number":120,"context_line":"            server\u003d\"1234-abcd\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        # now to test the cache"},{"line_number":123,"context_line":"        mock_novaclient.reset_mock()"},{"line_number":124,"context_line":"        action.run()"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d15be4f4","line":122,"range":{"start_line":122,"start_character":9,"end_line":122,"end_character":31},"in_reply_to":"bacf61ea_da9046ef","updated":"2016-07-28 21:25:59.000000000","message":"It\u0027s \"now\" as in we\u0027ve arrived to the second part of the test. I can clear it up.","commit_id":"fbba7c142712a436ac8d4a24fe847c757254607e"}],"mistral/tests/unit/api/base.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"4bbe1df43ae9ac3fd263333fd4da7b4b771b642b","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # Make sure the api get the correct context."},{"line_number":60,"context_line":"        self.patch_ctx \u003d mock.patch("},{"line_number":61,"context_line":"            \u0027mistral.context.context_from_headers_and_env\u0027)"},{"line_number":62,"context_line":"        self.mock_ctx \u003d self.patch_ctx.start()"},{"line_number":63,"context_line":"        self.mock_ctx.return_value \u003d self.ctx"},{"line_number":64,"context_line":"        self.addCleanup(self.patch_ctx.stop)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_f959b18f","line":61,"range":{"start_line":61,"start_character":58,"end_line":61,"end_character":59},"updated":"2016-07-25 11:21:36.000000000","message":"Soft: End bracket should be in new line","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # Make sure the api get the correct context."},{"line_number":60,"context_line":"        self.patch_ctx \u003d mock.patch("},{"line_number":61,"context_line":"            \u0027mistral.context.context_from_headers_and_env\u0027)"},{"line_number":62,"context_line":"        self.mock_ctx \u003d self.patch_ctx.start()"},{"line_number":63,"context_line":"        self.mock_ctx.return_value \u003d self.ctx"},{"line_number":64,"context_line":"        self.addCleanup(self.patch_ctx.stop)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_8f35a747","line":61,"range":{"start_line":61,"start_character":58,"end_line":61,"end_character":59},"in_reply_to":"dada55a8_f959b18f","updated":"2016-07-25 20:35:20.000000000","message":"Done","commit_id":"c0857647017df4fe474296ad18034fda529cd511"}],"mistral/tests/unit/api/v2/test_keycloak_auth.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"4bbe1df43ae9ac3fd263333fd4da7b4b771b642b","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        # Make sure the api get the correct context."},{"line_number":120,"context_line":"        self.patch_ctx \u003d mock.patch("},{"line_number":121,"context_line":"            \u0027mistral.context.context_from_headers_and_env\u0027)"},{"line_number":122,"context_line":"        self.mock_ctx \u003d self.patch_ctx.start()"},{"line_number":123,"context_line":"        self.mock_ctx.return_value \u003d self.ctx"},{"line_number":124,"context_line":"        self.addCleanup(self.patch_ctx.stop)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_5949ddb6","line":121,"range":{"start_line":121,"start_character":58,"end_line":121,"end_character":59},"updated":"2016-07-25 11:21:36.000000000","message":"Soft: End bracket should be in a new line","commit_id":"c0857647017df4fe474296ad18034fda529cd511"},{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"ffe15dacb26789f233421dbffe120a326b264ed3","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        # Make sure the api get the correct context."},{"line_number":120,"context_line":"        self.patch_ctx \u003d mock.patch("},{"line_number":121,"context_line":"            \u0027mistral.context.context_from_headers_and_env\u0027)"},{"line_number":122,"context_line":"        self.mock_ctx \u003d self.patch_ctx.start()"},{"line_number":123,"context_line":"        self.mock_ctx.return_value \u003d self.ctx"},{"line_number":124,"context_line":"        self.addCleanup(self.patch_ctx.stop)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_8fe8077e","line":121,"range":{"start_line":121,"start_character":58,"end_line":121,"end_character":59},"in_reply_to":"dada55a8_5949ddb6","updated":"2016-07-25 20:35:20.000000000","message":"Done","commit_id":"c0857647017df4fe474296ad18034fda529cd511"}],"mistral/utils/openstack/keystone.py":[{"author":{"_account_id":3098,"name":"Jeff Peeler","email":"jpeeler@redhat.com","username":"jpeeler-z"},"change_message_id":"dd67ef0c07a396c7af037b60aa738349eac630e5","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from keystoneclient.v3 import endpoints as enp"},{"line_number":20,"context_line":"from oslo_utils import timeutils"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from mistral.config import CONF"},{"line_number":23,"context_line":"from mistral import context"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"TOKEN_DURATION \u003d CONF.expiration_token_duration"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ac06dbe_a4d31b5f","line":22,"updated":"2016-08-23 16:14:00.000000000","message":"It looks like I\u0027m importing an object here, when I shouldn\u0027t be. Will correct next cycle.","commit_id":"d585dcb9523e9f7c40ce4ddb07569456f00e556b"}]}
