)]}'
{"nova/policies/base.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7bb05bf6f0ec182219d7811ad2472987bb105601","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    return policy.RuleDefault(name, check_str, formatted_description)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"NETWORK_ATTACH_EXTERNAL \u003d \u0027network:attach_external_network\u0027"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"# NOTE(johngarbutt) The base rules here affect so many APIs the list"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_4cb6f5fc","line":57,"updated":"2017-06-13 09:30:37.000000000","message":"This one I just moved never its usage, I guess it should go back up the top.","commit_id":"7ff06b03eacfe444ff1f370fae5a30bd1ee77cb2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9c61aafe49b46b9ae2a2038f695fe2e3572b7290","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    create_rule_default("},{"line_number":77,"context_line":"        NETWORK_ATTACH_EXTERNAL,"},{"line_number":78,"context_line":"        \u0027is_admin:True\u0027,"},{"line_number":79,"context_line":"        \"Creates one or more external events, which the API dispatches to \""},{"line_number":80,"context_line":"        \"the host a server is assigned to.\","},{"line_number":81,"context_line":"        ["},{"line_number":82,"context_line":"            {"},{"line_number":83,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"},{"line_number":84,"context_line":"                \u0027path\u0027: \u0027/os-server-external-events\u0027"},{"line_number":85,"context_line":"            }"},{"line_number":86,"context_line":"        ]),"},{"line_number":87,"context_line":"]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_d9b5d333","line":86,"range":{"start_line":79,"start_character":8,"end_line":86,"end_character":11},"updated":"2017-06-15 13:26:45.000000000","message":"I don\u0027t think this is correct. This doesn\u0027t have anything to do with os-server-external-events as far as I can tell.\n\nIt\u0027s used in the neutronv2 API code (when we\u0027re on the nova-compute service by this time):\n\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L464\n\nThat means that by default, only admins can boot a server and create ports on an external non-shared network.","commit_id":"7ff06b03eacfe444ff1f370fae5a30bd1ee77cb2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3bd226515bf47e7d8af0fe7355f132991449d97b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    create_rule_default("},{"line_number":77,"context_line":"        NETWORK_ATTACH_EXTERNAL,"},{"line_number":78,"context_line":"        \u0027is_admin:True\u0027,"},{"line_number":79,"context_line":"        \"Creates one or more external events, which the API dispatches to \""},{"line_number":80,"context_line":"        \"the host a server is assigned to.\","},{"line_number":81,"context_line":"        ["},{"line_number":82,"context_line":"            {"},{"line_number":83,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"},{"line_number":84,"context_line":"                \u0027path\u0027: \u0027/os-server-external-events\u0027"},{"line_number":85,"context_line":"            }"},{"line_number":86,"context_line":"        ]),"},{"line_number":87,"context_line":"]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_b9e0d727","line":86,"range":{"start_line":79,"start_character":8,"end_line":86,"end_character":11},"in_reply_to":"7f231b9d_d9b5d333","updated":"2017-06-15 13:28:43.000000000","message":"http://lists.openstack.org/pipermail/openstack-dev/2016-June/096919.html","commit_id":"7ff06b03eacfe444ff1f370fae5a30bd1ee77cb2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"02709e5cf4aea362cb2714e39fcfdf3743c780b5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    return policy.RuleDefault(name, check_str, formatted_description)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"NETWORK_ATTACH_EXTERNAL \u003d \u0027network:attach_external_network\u0027"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"# NOTE(johngarbutt) The base rules here affect so many APIs the list"},{"line_number":61,"context_line":"# of related API operations has not been populated. It would be"},{"line_number":62,"context_line":"# crazy hard to manually maintain such a list."},{"line_number":63,"context_line":"rules \u003d ["},{"line_number":64,"context_line":"    policy.RuleDefault("},{"line_number":65,"context_line":"        \"context_is_admin\","},{"line_number":66,"context_line":"        \"role:admin\","},{"line_number":67,"context_line":"        \"Decides what is required for the \u0027is_admin:True\u0027 check to succeed.\"),"},{"line_number":68,"context_line":"    policy.RuleDefault("},{"line_number":69,"context_line":"        \"admin_or_owner\","},{"line_number":70,"context_line":"        \"is_admin:True or project_id:%(project_id)s\","},{"line_number":71,"context_line":"        \"Default rule for most non-Admin APIs.\"),"},{"line_number":72,"context_line":"    policy.RuleDefault("},{"line_number":73,"context_line":"        \"admin_api\","},{"line_number":74,"context_line":"        \"is_admin:True\","},{"line_number":75,"context_line":"        \"Default rule for most Admin APIs.\"),"},{"line_number":76,"context_line":"    create_rule_default("},{"line_number":77,"context_line":"        NETWORK_ATTACH_EXTERNAL,"},{"line_number":78,"context_line":"        \u0027is_admin:True\u0027,"},{"line_number":79,"context_line":"        \"Creates one or more external events, which the API dispatches to \""},{"line_number":80,"context_line":"        \"the host a server is assigned to.\","},{"line_number":81,"context_line":"        ["},{"line_number":82,"context_line":"            {"},{"line_number":83,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"},{"line_number":84,"context_line":"                \u0027path\u0027: \u0027/os-server-external-events\u0027"},{"line_number":85,"context_line":"            }"},{"line_number":86,"context_line":"        ]),"},{"line_number":87,"context_line":"]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"def list_rules():"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_39590bfe","line":87,"range":{"start_line":57,"start_character":0,"end_line":87,"end_character":1},"updated":"2017-06-09 15:44:41.000000000","message":"um, why are we moving this?","commit_id":"7ff06b03eacfe444ff1f370fae5a30bd1ee77cb2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"10fca68ca2f3cef195940e023b980a6a2c0eda25","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    return policy.RuleDefault(name, check_str, formatted_description)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"NETWORK_ATTACH_EXTERNAL \u003d \u0027network:attach_external_network\u0027"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"# NOTE(johngarbutt) The base rules here affect so many APIs the list"},{"line_number":61,"context_line":"# of related API operations has not been populated. It would be"},{"line_number":62,"context_line":"# crazy hard to manually maintain such a list."},{"line_number":63,"context_line":"rules \u003d ["},{"line_number":64,"context_line":"    policy.RuleDefault("},{"line_number":65,"context_line":"        \"context_is_admin\","},{"line_number":66,"context_line":"        \"role:admin\","},{"line_number":67,"context_line":"        \"Decides what is required for the \u0027is_admin:True\u0027 check to succeed.\"),"},{"line_number":68,"context_line":"    policy.RuleDefault("},{"line_number":69,"context_line":"        \"admin_or_owner\","},{"line_number":70,"context_line":"        \"is_admin:True or project_id:%(project_id)s\","},{"line_number":71,"context_line":"        \"Default rule for most non-Admin APIs.\"),"},{"line_number":72,"context_line":"    policy.RuleDefault("},{"line_number":73,"context_line":"        \"admin_api\","},{"line_number":74,"context_line":"        \"is_admin:True\","},{"line_number":75,"context_line":"        \"Default rule for most Admin APIs.\"),"},{"line_number":76,"context_line":"    create_rule_default("},{"line_number":77,"context_line":"        NETWORK_ATTACH_EXTERNAL,"},{"line_number":78,"context_line":"        \u0027is_admin:True\u0027,"},{"line_number":79,"context_line":"        \"Creates one or more external events, which the API dispatches to \""},{"line_number":80,"context_line":"        \"the host a server is assigned to.\","},{"line_number":81,"context_line":"        ["},{"line_number":82,"context_line":"            {"},{"line_number":83,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"},{"line_number":84,"context_line":"                \u0027path\u0027: \u0027/os-server-external-events\u0027"},{"line_number":85,"context_line":"            }"},{"line_number":86,"context_line":"        ]),"},{"line_number":87,"context_line":"]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"def list_rules():"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_ec1ca114","line":87,"range":{"start_line":57,"start_character":0,"end_line":87,"end_character":1},"in_reply_to":"7f231b9d_39590bfe","updated":"2017-06-13 09:29:51.000000000","message":"I moved it so the rules variable is closer to its usage in list_rules. The rest of the logic in here is separate, so its more consistent with the other files to keep that above here, and as we use the function in generating rules, I like defining the function before using it.","commit_id":"7ff06b03eacfe444ff1f370fae5a30bd1ee77cb2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a280c1ffcf2691e7420971448b17362fce6030e7","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":41,"context_line":"        NETWORK_ATTACH_EXTERNAL,"},{"line_number":42,"context_line":"        \u0027is_admin:True\u0027,"},{"line_number":43,"context_line":"        \"Creates one or more external events, which the API dispatches to \""},{"line_number":44,"context_line":"        \"the host a server is assigned to.\","},{"line_number":45,"context_line":"        ["},{"line_number":46,"context_line":"            {"},{"line_number":47,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f1d235d_677c15b5","line":44,"range":{"start_line":43,"start_character":9,"end_line":44,"end_character":42},"updated":"2017-07-03 14:48:45.000000000","message":"This is wrong.\n\nThis is really a check in the nova-compute service when allocating networks for a server during create which checks to see if the network being used to create a port is an external network, and if so it fails for non-admins by default. This isn\u0027t checked in the API (which is unfortunate), but if anything the closest API would be POST /servers.\n\nThis would actually make more sense if it lived in the nova.policy.servers module since that has os_compute_api:servers:create:attach_network which is checked in POST /servers when you\u0027ve requested specific networks or ports.","commit_id":"36c2b25f8464499fc2c750989eeb51ea5c8757c0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56420de955938d55c5be4eac5d3e3bcc59ee42f2","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        ["},{"line_number":46,"context_line":"            {"},{"line_number":47,"context_line":"                \u0027method\u0027: \u0027POST\u0027,"},{"line_number":48,"context_line":"                \u0027path\u0027: \u0027/os-server-external-events\u0027"},{"line_number":49,"context_line":"            }"},{"line_number":50,"context_line":"        ]),"},{"line_number":51,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f1d235d_c7a3e99d","line":48,"range":{"start_line":48,"start_character":25,"end_line":48,"end_character":52},"updated":"2017-07-03 14:33:44.000000000","message":"See my comment in PS4, this doesn\u0027t have anything to do with os-server-external-events.","commit_id":"36c2b25f8464499fc2c750989eeb51ea5c8757c0"}]}
