)]}'
{"etc/policy.json":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"delete_subnet\": [[\"rule:admin_or_network_owner\"]],"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    \"create_network\": [],"},{"line_number":27,"context_line":"    \"get_network\": [[\"rule:admin_or_owner\"], [\"rule:shared\"], [\"rule:external\"]],"},{"line_number":28,"context_line":"    \"create_network:shared\": [[\"rule:admin_only\"]],"},{"line_number":29,"context_line":"    \"create_network:router:external\": [[\"rule:admin_only\"]],"},{"line_number":30,"context_line":"    \"update_network\": [[\"rule:admin_or_owner\"]],"}],"source_content_type":"application/json","patch_set":8,"id":"AAAALH%2F%2FeA0%3D","line":27,"updated":"2012-09-08 01:04:09.000000000","message":"Any one can see all of the external networks even they are belonging to other tenants?","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":24,"context_line":"    \"delete_subnet\": [[\"rule:admin_or_network_owner\"]],"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    \"create_network\": [],"},{"line_number":27,"context_line":"    \"get_network\": [[\"rule:admin_or_owner\"], [\"rule:shared\"], [\"rule:external\"]],"},{"line_number":28,"context_line":"    \"create_network:shared\": [[\"rule:admin_only\"]],"},{"line_number":29,"context_line":"    \"create_network:router:external\": [[\"rule:admin_only\"]],"},{"line_number":30,"context_line":"    \"update_network\": [[\"rule:admin_or_owner\"]],"}],"source_content_type":"application/json","patch_set":8,"id":"AAAALH%2F%2Fd%2Bg%3D","line":27,"in_reply_to":"AAAALH%2F%2FeA0%3D","updated":"2012-09-08 05:30:42.000000000","message":"external networks can only be created by admin (see above).  And yes, all users can see all external networks.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"}],"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"607a0b5fa1e9240ea8a265e967339f7ee6ddb82f","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        model_hooks[name] \u003d {\u0027query\u0027: query_hook, \u0027filter\u0027: filter_hook}"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    @classmethod"},{"line_number":132,"context_line":"    def unregister_model_query_hook(cls, model, name):"},{"line_number":133,"context_line":"        \"\"\" Remove the specified hook for the selected model \"\"\""},{"line_number":134,"context_line":"        if model in cls._model_query_hooks:"},{"line_number":135,"context_line":"            if name in cls._model_query_hooks[model]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fg%2B8%3D","line":132,"updated":"2012-09-05 02:20:05.000000000","message":"when/why is this called?","commit_id":"b752e415de24ca37676ce4e8806f3b5111005faa"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":129,"context_line":"        model_hooks[name] \u003d {\u0027query\u0027: query_hook, \u0027filter\u0027: filter_hook}"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    @classmethod"},{"line_number":132,"context_line":"    def unregister_model_query_hook(cls, model, name):"},{"line_number":133,"context_line":"        \"\"\" Remove the specified hook for the selected model \"\"\""},{"line_number":134,"context_line":"        if model in cls._model_query_hooks:"},{"line_number":135,"context_line":"            if name in cls._model_query_hooks[model]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fg0M%3D","line":132,"in_reply_to":"AAAALH%2F%2Fg%2B8%3D","updated":"2012-09-05 08:16:51.000000000","message":"I forgot to remove the method in my last push.\nI initially implemented it but then realized it was useless","commit_id":"b752e415de24ca37676ce4e8806f3b5111005faa"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0ced79f8176d612d7a98aafbc580a1dd1fb92014","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            else:"},{"line_number":91,"context_line":"                query_filter \u003d (model.tenant_id \u003d\u003d context.tenant_id)"},{"line_number":92,"context_line":"        # Execute query hooks registered from mixins and plugins"},{"line_number":93,"context_line":"        for _name, hooks in self._model_query_hooks.get(model,"},{"line_number":94,"context_line":"                                                        {}).iteritems():"},{"line_number":95,"context_line":"            query_hook \u003d hooks.get(\u0027query\u0027)"},{"line_number":96,"context_line":"            filter_hook \u003d hooks.get(\u0027filter\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FfgQ%3D","line":93,"updated":"2012-09-06 15:15:27.000000000","message":"is _name used?","commit_id":"0302fe7bb8733ca37c177f3f40a5ebcdfd7091b1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":90,"context_line":"            else:"},{"line_number":91,"context_line":"                query_filter \u003d (model.tenant_id \u003d\u003d context.tenant_id)"},{"line_number":92,"context_line":"        # Execute query hooks registered from mixins and plugins"},{"line_number":93,"context_line":"        for _name, hooks in self._model_query_hooks.get(model,"},{"line_number":94,"context_line":"                                                        {}).iteritems():"},{"line_number":95,"context_line":"            query_hook \u003d hooks.get(\u0027query\u0027)"},{"line_number":96,"context_line":"            filter_hook \u003d hooks.get(\u0027filter\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2FfUQ%3D","line":93,"in_reply_to":"AAAALH%2F%2Ffe4%3D","updated":"2012-09-06 18:40:37.000000000","message":"That is correct, I don\u0027t need the name, which I use only for ensuring the hook is not registered more than once.\n\nitervalues is surely better.","commit_id":"0302fe7bb8733ca37c177f3f40a5ebcdfd7091b1"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":90,"context_line":"            else:"},{"line_number":91,"context_line":"                query_filter \u003d (model.tenant_id \u003d\u003d context.tenant_id)"},{"line_number":92,"context_line":"        # Execute query hooks registered from mixins and plugins"},{"line_number":93,"context_line":"        for _name, hooks in self._model_query_hooks.get(model,"},{"line_number":94,"context_line":"                                                        {}).iteritems():"},{"line_number":95,"context_line":"            query_hook \u003d hooks.get(\u0027query\u0027)"},{"line_number":96,"context_line":"            filter_hook \u003d hooks.get(\u0027filter\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2Ffe4%3D","line":93,"in_reply_to":"AAAALH%2F%2FfgQ%3D","updated":"2012-09-06 15:41:52.000000000","message":"prefacing a variable like this with an underscore is a common python convention to indicate that the programmer recognizes that a variable is not being used.\n\nI do agree that at a glance it would seem cleaner to use .values() rather than using .iteritems() and indicating that the key value will be ignored.  Perhaps Salvatore can comment.","commit_id":"0302fe7bb8733ca37c177f3f40a5ebcdfd7091b1"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def _get_by_id(self, context, model, id):"},{"line_number":132,"context_line":"        query \u003d self._model_query(context, model)"},{"line_number":133,"context_line":"        query \u003d query.filter(model.id \u003d\u003d id).one()"},{"line_number":134,"context_line":"        return query"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _get_network(self, context, id):"},{"line_number":137,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FeDA%3D","line":134,"updated":"2012-09-08 01:04:09.000000000","message":"The one() is still query? how about _qeury_result?","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def _get_by_id(self, context, model, id):"},{"line_number":132,"context_line":"        query \u003d self._model_query(context, model)"},{"line_number":133,"context_line":"        query \u003d query.filter(model.id \u003d\u003d id).one()"},{"line_number":134,"context_line":"        return query"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _get_network(self, context, id):"},{"line_number":137,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FduI%3D","line":134,"in_reply_to":"AAAALH%2F%2Fd%2Bc%3D","updated":"2012-09-08 20:19:37.000000000","message":"The double line is just because I added some debug statement in the middle and then forgot to restore the code as it was after removing the debug statement.\n\nOn _query_result I confess my ignorance. I haven\u0027t found any reference to it in sqlalchemy - and also it seems an \"internal\" property, which is subject to change.\none() just builds a list out of the query object and either returns the first element or an exception. So it is not a query anymore.\n\nI will condense the two statements in one.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def _get_by_id(self, context, model, id):"},{"line_number":132,"context_line":"        query \u003d self._model_query(context, model)"},{"line_number":133,"context_line":"        query \u003d query.filter(model.id \u003d\u003d id).one()"},{"line_number":134,"context_line":"        return query"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _get_network(self, context, id):"},{"line_number":137,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fd%2Bc%3D","line":134,"in_reply_to":"AAAALH%2F%2FeDA%3D","updated":"2012-09-08 05:30:42.000000000","message":"seems like a good suggestion.  While we\u0027re at it, seems like you can just return the result in the same line.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"}],"quantum/db/l3_db.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"607a0b5fa1e9240ea8a265e967339f7ee6ddb82f","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    # TODO(salvatore-orlando): Perform this operation without explicitly"},{"line_number":106,"context_line":"    # referring to db_base_plugin_v2, as plugins that do not extend from it"},{"line_number":107,"context_line":"    # might exist in the future"},{"line_number":108,"context_line":"    db_base_plugin_v2.QuantumDbPluginV2.register_model_query_hook("},{"line_number":109,"context_line":"        models_v2.Network,"},{"line_number":110,"context_line":"        \"external_net\","}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fg%2B4%3D","line":107,"updated":"2012-09-05 02:20:05.000000000","message":"it seems like this who mechanism is fairly bound to how the db_base_plugin_v2 querying works, so what you\u0027re doing now seems reasonable...","commit_id":"b752e415de24ca37676ce4e8806f3b5111005faa"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    # TODO(salvatore-orlando): Perform this operation without explicitly"},{"line_number":106,"context_line":"    # referring to db_base_plugin_v2, as plugins that do not extend from it"},{"line_number":107,"context_line":"    # might exist in the future"},{"line_number":108,"context_line":"    db_base_plugin_v2.QuantumDbPluginV2.register_model_query_hook("},{"line_number":109,"context_line":"        models_v2.Network,"},{"line_number":110,"context_line":"        \"external_net\","}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fg0E%3D","line":107,"in_reply_to":"AAAALH%2F%2Fg%2B4%3D","updated":"2012-09-05 08:16:51.000000000","message":"My reasoning was that db_base_plugin_v2 should be the authoritative source for db operations.\nOne caveat is that maybe one would like to have completely separated l3 and l2 plugins. As I realized the l3 mixin was already leveraging methods such as get_by_id, I then decided to go for this approach. I think having a L3 plugin leveraging functions offered by the L2 plugin is fine. \n\nFrom your comment I don\u0027t understand if you think that this approach is reasonable just for the moment, or is reasonable in \"general\"","commit_id":"b752e415de24ca37676ce4e8806f3b5111005faa"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":188,"context_line":"                router.update({\u0027gw_port_id\u0027: None})"},{"line_number":189,"context_line":"                context.session.add(router)"},{"line_number":190,"context_line":"            self.delete_port(context.elevated(), gw_port[\u0027id\u0027],"},{"line_number":191,"context_line":"                             l3_port_check\u003dFalse)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        if network_id is not None and (gw_port is None or"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FehU%3D","line":190,"updated":"2012-09-07 16:06:00.000000000","message":"why do we thinking up to elevate the context now? the previous normal one failed to do the jobs?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":187,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":188,"context_line":"                router.update({\u0027gw_port_id\u0027: None})"},{"line_number":189,"context_line":"                context.session.add(router)"},{"line_number":190,"context_line":"            self.delete_port(context.elevated(), gw_port[\u0027id\u0027],"},{"line_number":191,"context_line":"                             l3_port_check\u003dFalse)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        if network_id is not None and (gw_port is None or"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FefY%3D","line":190,"in_reply_to":"AAAALH%2F%2FehU%3D","updated":"2012-09-07 16:51:54.000000000","message":"While the user creates the floating ip within its own context, the port backing the floating ip itself is not controlled directly by the tenant; indeed we do not want to even show them when the tenant executes port_list. Hence, they are created in an elevated context.\n\nAlso, the subnet associated with these ports is usually not accessbile to tenants. The default policy is indeed admin_or_network_owner for create_port:router:external. This means normal tenant would be blocked by the policy checks when attempting to create floating ips.","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                             \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":231,"context_line":"            ports \u003d self.get_ports(context.elevated(), filters\u003ddevice_filter)"},{"line_number":232,"context_line":"            if ports:"},{"line_number":233,"context_line":"                self._delete_port(context.elevated(), ports[0][\u0027id\u0027])"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"            context.session.delete(router)"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FejY%3D","line":233,"updated":"2012-09-07 16:06:00.000000000","message":"the original comments said the gw_port will be deleted auto due to the cascading of ORM relationship, why do we need to delete it now?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":230,"context_line":"                             \u0027device_owner\u0027: [DEVICE_OWNER_ROUTER_GW]}"},{"line_number":231,"context_line":"            ports \u003d self.get_ports(context.elevated(), filters\u003ddevice_filter)"},{"line_number":232,"context_line":"            if ports:"},{"line_number":233,"context_line":"                self._delete_port(context.elevated(), ports[0][\u0027id\u0027])"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"            context.session.delete(router)"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2Fef4%3D","line":233,"in_reply_to":"AAAALH%2F%2FejY%3D","updated":"2012-09-07 16:51:54.000000000","message":"Because the direction of the foreign relationship was wrong, and so the actual effect would have been deleting the router if the gateway port were removed.\n\nThis was an error on my side - I must have done it under the effect of drugs, as I could not even remember adding that comment!","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # managing floating IPs."},{"line_number":509,"context_line":"        external_port \u003d self.create_port(context.elevated(), {"},{"line_number":510,"context_line":"            \u0027port\u0027:"},{"line_number":511,"context_line":"            {\u0027tenant_id\u0027: \u0027\u0027,  # tenant intentionally not set"},{"line_number":512,"context_line":"             \u0027network_id\u0027: f_net_id,"},{"line_number":513,"context_line":"             \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":514,"context_line":"             \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FejA%3D","line":511,"updated":"2012-09-07 16:06:00.000000000","message":"why?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # managing floating IPs."},{"line_number":509,"context_line":"        external_port \u003d self.create_port(context.elevated(), {"},{"line_number":510,"context_line":"            \u0027port\u0027:"},{"line_number":511,"context_line":"            {\u0027tenant_id\u0027: \u0027\u0027,  # tenant intentionally not set"},{"line_number":512,"context_line":"             \u0027network_id\u0027: f_net_id,"},{"line_number":513,"context_line":"             \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":514,"context_line":"             \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2Fefs%3D","line":511,"in_reply_to":"AAAALH%2F%2FejA%3D","updated":"2012-09-07 16:51:54.000000000","message":"This is a good point.\nWe found out that if the tenant_id was not explicitly set to the empty string, the methods in db_base_plugin would set it \"automagically\" extracting it from the context","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        if not external_port[\u0027fixed_ips\u0027]:"},{"line_number":521,"context_line":"            msg \u003d \"Unable to find any IP address on external network\""},{"line_number":522,"context_line":"            # remove the external port"},{"line_number":523,"context_line":"            self.delete_port(context.elevated(), l3_port_check\u003dFalse)"},{"line_number":524,"context_line":"            raise q_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"        floating_ip_address \u003d external_port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FehQ%3D","line":523,"updated":"2012-09-07 16:06:00.000000000","message":"Where is the port_id parameter?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":520,"context_line":"        if not external_port[\u0027fixed_ips\u0027]:"},{"line_number":521,"context_line":"            msg \u003d \"Unable to find any IP address on external network\""},{"line_number":522,"context_line":"            # remove the external port"},{"line_number":523,"context_line":"            self.delete_port(context.elevated(), l3_port_check\u003dFalse)"},{"line_number":524,"context_line":"            raise q_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"        floating_ip_address \u003d external_port[\u0027fixed_ips\u0027][0][\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2Fefo%3D","line":523,"in_reply_to":"AAAALH%2F%2FehQ%3D","updated":"2012-09-07 16:51:54.000000000","message":"My bad - and probably missing unit tests coverage.\nThanks for spoitting it.","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # Port has no \u0027tenant-id\u0027, as it is hidden from user"},{"line_number":196,"context_line":"            gw_port \u003d self.create_port(context.elevated(), {"},{"line_number":197,"context_line":"                \u0027port\u0027:"},{"line_number":198,"context_line":"                {\u0027tenant_id\u0027: \u0027\u0027,  # intentionally not set"},{"line_number":199,"context_line":"                 \u0027network_id\u0027: network_id,"},{"line_number":200,"context_line":"                 \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":201,"context_line":"                 \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FeCs%3D","line":198,"updated":"2012-09-08 01:04:09.000000000","message":"So the ports on external networks are not owned by any tenants, right?\nthe floating ips are all created on the external networks, their ports are not tenant binding, right?\n\nCan we set up a rule?:\nthe external network cannot host tenanted ports so that we can make the external network clean and the whole system consistent","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # Port has no \u0027tenant-id\u0027, as it is hidden from user"},{"line_number":196,"context_line":"            gw_port \u003d self.create_port(context.elevated(), {"},{"line_number":197,"context_line":"                \u0027port\u0027:"},{"line_number":198,"context_line":"                {\u0027tenant_id\u0027: \u0027\u0027,  # intentionally not set"},{"line_number":199,"context_line":"                 \u0027network_id\u0027: network_id,"},{"line_number":200,"context_line":"                 \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":201,"context_line":"                 \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FduE%3D","line":198,"in_reply_to":"AAAALH%2F%2Fd9w%3D","updated":"2012-09-08 20:19:37.000000000","message":"We have a rule actually:\n\n\"create_port:router:external\": [[\"rule:admin_or_network_owner\"]],\n\nWithout this rule, any tenant would be able to create ports on the external network.\n\nDan\u0027s comment actually made me think that this rule as it is might forbid tenants from creating ports on networks which are enabled and shared - so I need to check and maybe change the rule.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # Port has no \u0027tenant-id\u0027, as it is hidden from user"},{"line_number":196,"context_line":"            gw_port \u003d self.create_port(context.elevated(), {"},{"line_number":197,"context_line":"                \u0027port\u0027:"},{"line_number":198,"context_line":"                {\u0027tenant_id\u0027: \u0027\u0027,  # intentionally not set"},{"line_number":199,"context_line":"                 \u0027network_id\u0027: network_id,"},{"line_number":200,"context_line":"                 \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":201,"context_line":"                 \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fd9w%3D","line":198,"in_reply_to":"AAAALH%2F%2FeCs%3D","updated":"2012-09-08 05:30:42.000000000","message":"Yes, floatingip and external gateway ports are not owned by a tenant.  Unless a network is already set to have --shared\u003dTrue, non-admin users will already be prohibited from creating ports on that network.  They will get an error: \n\n{\"QuantumError\": \"Tenant 59a8340859734f7e815127705a83bab7 not allowed to create port on this network\"}\n\nHowever, it is a valid deployment model that a cloud administrator could also let users plug VMs directly into an external network.  In that case, the administrator should set --shared\u003dTrue on that network as well as router:external\u003dTrue.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # managing floating IPs."},{"line_number":509,"context_line":"        external_port \u003d self.create_port(context.elevated(), {"},{"line_number":510,"context_line":"            \u0027port\u0027:"},{"line_number":511,"context_line":"            {\u0027tenant_id\u0027: \u0027\u0027,  # tenant intentionally not set"},{"line_number":512,"context_line":"             \u0027network_id\u0027: f_net_id,"},{"line_number":513,"context_line":"             \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":514,"context_line":"             \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FeCo%3D","line":511,"updated":"2012-09-08 01:04:09.000000000","message":"Here, it is. the floating ips and the router\u0027s gw port are all not tenant binding.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # managing floating IPs."},{"line_number":509,"context_line":"        external_port \u003d self.create_port(context.elevated(), {"},{"line_number":510,"context_line":"            \u0027port\u0027:"},{"line_number":511,"context_line":"            {\u0027tenant_id\u0027: \u0027\u0027,  # tenant intentionally not set"},{"line_number":512,"context_line":"             \u0027network_id\u0027: f_net_id,"},{"line_number":513,"context_line":"             \u0027mac_address\u0027: attributes.ATTR_NOT_SPECIFIED,"},{"line_number":514,"context_line":"             \u0027fixed_ips\u0027: attributes.ATTR_NOT_SPECIFIED,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FduA%3D","line":511,"in_reply_to":"AAAALH%2F%2FeCo%3D","updated":"2012-09-08 20:19:37.000000000","message":"Yong, I am afraid I do not fully understand your comment.\nThe router gateway port, just like the floating IP ports, should be regarded as system ports, and not owned by the tenant which own the floating ip, or the router.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"}],"quantum/extensions/l3.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum import manager"},{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum import policy"},{"line_number":31,"context_line":"from quantum.policy import get_resource_and_action"},{"line_number":32,"context_line":"from quantum import quota"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FeCk%3D","line":31,"updated":"2012-09-08 01:04:09.000000000","message":"Why cannot I see the usages of these two new imports in the changes of this file?","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum import manager"},{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum import policy"},{"line_number":31,"context_line":"from quantum.policy import get_resource_and_action"},{"line_number":32,"context_line":"from quantum import quota"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fdt8%3D","line":31,"in_reply_to":"AAAALH%2F%2Fd9s%3D","updated":"2012-09-08 20:19:37.000000000","message":"Because I forgot to remove the unused imports...","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":28,"context_line":"from quantum import manager"},{"line_number":29,"context_line":"from quantum.openstack.common import cfg"},{"line_number":30,"context_line":"from quantum import policy"},{"line_number":31,"context_line":"from quantum.policy import get_resource_and_action"},{"line_number":32,"context_line":"from quantum import quota"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fd9s%3D","line":31,"in_reply_to":"AAAALH%2F%2FeCk%3D","updated":"2012-09-08 05:30:42.000000000","message":"agreed.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"}],"quantum/policy.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":"_POLICY_PATH \u003d None"},{"line_number":32,"context_line":"_POLICY_CACHE \u003d {}"},{"line_number":33,"context_line":"_CUSTOM_MATCH_FUNCTIONS \u003d {}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def reset():"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2Fehg%3D","line":33,"updated":"2012-09-07 16:06:00.000000000","message":"where is it used?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":"_POLICY_PATH \u003d None"},{"line_number":32,"context_line":"_POLICY_CACHE \u003d {}"},{"line_number":33,"context_line":"_CUSTOM_MATCH_FUNCTIONS \u003d {}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def reset():"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FefI%3D","line":33,"in_reply_to":"AAAALH%2F%2Fehg%3D","updated":"2012-09-07 16:51:54.000000000","message":"This is a leftover of the last change I did to the policy engine","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                           reload_func\u003d_set_brain)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def get_resource_and_action(action):"},{"line_number":58,"context_line":"    data \u003d action.split(\u0027:\u0027, 1)[0].split(\u0027_\u0027, 1)"},{"line_number":59,"context_line":"    return (\"%ss\" % data[-1], data[0] !\u003d \u0027get\u0027)"},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2Fehk%3D","line":57,"updated":"2012-09-07 16:06:00.000000000","message":"Can we add a brief docstring for this method: such as what  the input parameter looks like, how the return looks like?","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":54,"context_line":"                           reload_func\u003d_set_brain)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def get_resource_and_action(action):"},{"line_number":58,"context_line":"    data \u003d action.split(\u0027:\u0027, 1)[0].split(\u0027_\u0027, 1)"},{"line_number":59,"context_line":"    return (\"%ss\" % data[-1], data[0] !\u003d \u0027get\u0027)"},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAALH%2F%2FefE%3D","line":57,"in_reply_to":"AAAALH%2F%2Fehk%3D","updated":"2012-09-07 16:51:54.000000000","message":"Sure","commit_id":"b548cf99daeacee7569f214b6813655b7fe328e2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7d8ba72dab24844b40e6fb38334a053afd240910","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    \"\"\""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    match_list \u003d (\u0027rule:%s\u0027 % action,)"},{"line_number":110,"context_line":"    resource, is_write \u003d get_resource_and_action(action)"},{"line_number":111,"context_line":"    # assigning to variable with short name for improving readability"},{"line_number":112,"context_line":"    res_map \u003d attributes.RESOURCE_ATTRIBUTE_MAP"},{"line_number":113,"context_line":"    if resource in res_map:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2FeBQ%3D","line":110,"updated":"2012-09-08 01:04:09.000000000","message":"can we pass following big block code if the is_write is False in this patch?","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":107,"context_line":"    \"\"\""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    match_list \u003d (\u0027rule:%s\u0027 % action,)"},{"line_number":110,"context_line":"    resource, is_write \u003d get_resource_and_action(action)"},{"line_number":111,"context_line":"    # assigning to variable with short name for improving readability"},{"line_number":112,"context_line":"    res_map \u003d attributes.RESOURCE_ATTRIBUTE_MAP"},{"line_number":113,"context_line":"    if resource in res_map:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fdt4%3D","line":110,"in_reply_to":"AAAALH%2F%2Fd9o%3D","updated":"2012-09-08 20:19:37.000000000","message":"Agreed","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":107,"context_line":"    \"\"\""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    match_list \u003d (\u0027rule:%s\u0027 % action,)"},{"line_number":110,"context_line":"    resource, is_write \u003d get_resource_and_action(action)"},{"line_number":111,"context_line":"    # assigning to variable with short name for improving readability"},{"line_number":112,"context_line":"    res_map \u003d attributes.RESOURCE_ATTRIBUTE_MAP"},{"line_number":113,"context_line":"    if resource in res_map:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALH%2F%2Fd9o%3D","line":110,"in_reply_to":"AAAALH%2F%2FeBQ%3D","updated":"2012-09-08 05:30:42.000000000","message":"seems like a good suggestion.","commit_id":"82b6147d9589aa3fcd9353f904e0b346a5cf8e25"}]}
