)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"26e93d05f7cba5d6c93ae51af552339b586f5882","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rehome policy and cache_utils"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Today we have neutron_lib._policy that is 1/2 baked, out of sync and was"},{"line_number":10,"context_line":"never consumed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch updates neutron_lib\u0027s policy with the latest from neutron"},{"line_number":13,"context_line":"with the following changes:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_27b923e8","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":14},"updated":"2018-01-30 19:39:26.000000000","message":"Disclaimer: I am trying to save you time and effort as I did look at this in the past. However, things might have changed and you may have more luck/be more capable than me :)\n\nWhen looking at this a while back [1], I determined that exporting the policy module in neutron-lib was not worth the effort for a couple of reasons:\n\n * policy is something specific to neutron-internals\n * the external dependencies didn\u0027t justify the pain\n * I could not see why external projects would need to access it instead of oslo_policy [3].\n\n\n[1] https://github.com/openstack/neutron-lib/commit/1902e2adf68e983ba96e088e767161424684813a\n[2] http://codesearch.openstack.org/?q\u003dfrom%20neutron%20import%20policy\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d\n[3] https://github.com/openstack/oslo.policy","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"976dad4c94bc88a45e731e96d577f25171b8d97d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rehome policy and cache_utils"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Today we have neutron_lib._policy that is 1/2 baked, out of sync and was"},{"line_number":10,"context_line":"never consumed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch updates neutron_lib\u0027s policy with the latest from neutron"},{"line_number":13,"context_line":"with the following changes:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df7087c5_3e173f54","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":14},"in_reply_to":"5f93b717_27b923e8","updated":"2018-03-10 10:30:00.000000000","message":"I am struggling how to address the dependency between neutron_lib.context and neutron policy loading.\n\nTo support policy-in-code in the neutron stadium, the neutron policy framework needs to load policy-in-code from all stadium projects. To do this, we need to update the policy loader.\n\nAt now, the policy loading is done in neutron_lib._policy as neutron_lib.context consumes the policy code.\n\nAs Armando says, most of the policy code is specific to neutron-internals, but some of them seems to be placed in neutron-lib.\n\nOr it would be nice if we can decouple context and policy check_is_(admin|advsvc), but as of now I don\u0027t have a good idea on doing this.","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"b43a66451c13f9be8c75d94033c3b71e313db71f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"rehome policy and cache_utils"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Today we have neutron_lib._policy that is 1/2 baked, out of sync and was"},{"line_number":10,"context_line":"never consumed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch updates neutron_lib\u0027s policy with the latest from neutron"},{"line_number":13,"context_line":"with the following changes:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf659307_87dea93b","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":14},"in_reply_to":"df7087c5_3e173f54","updated":"2018-04-03 22:01:22.000000000","message":"As per this patchset, the policy and related code (herein) came over to lib fairly easily without many dependencies. So while it does have some coupling to neutron internals, I question if it really has any more than some of the code already living in neutron-lib.\n\n\nToday we only have a few consumers [1], but I suppose it\u0027s foreseeable that decoupled plugin (projects) could introduce their own controllers as part of API extensions and need to use the policy; no?\n\n\nAs for the policy in code; I guess I\u0027m not fully understanding the problem. Is there some sample patches that could help me?\n\n\n\n[1] http://codesearch.openstack.org/?q\u003dfrom%20neutron%20import%20policy\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4c288843cb03d80957ed91690b505d8700adce29","unresolved":false,"context_lines":[{"line_number":19,"context_line":"up."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"In addition neutron.common.cache_utils is rehomed as"},{"line_number":22,"context_line":"neutron_lib.utils.cache. While not used outside neutron today [1], it\u0027s"},{"line_number":23,"context_line":"needed by policy and generic in nature."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"TEMP TESTING PATCH for neutron consumption:"},{"line_number":26,"context_line":"Depends-On: I300323961a35385e597d803348ca2f877ee55fdd"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_a7d533e7","line":23,"range":{"start_line":22,"start_character":67,"end_line":23,"end_character":16},"updated":"2018-01-30 19:43:26.000000000","message":"can you point out where that is? I can\u0027t seem to spot it.","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"b43a66451c13f9be8c75d94033c3b71e313db71f","unresolved":false,"context_lines":[{"line_number":19,"context_line":"up."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"In addition neutron.common.cache_utils is rehomed as"},{"line_number":22,"context_line":"neutron_lib.utils.cache. While not used outside neutron today [1], it\u0027s"},{"line_number":23,"context_line":"needed by policy and generic in nature."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"TEMP TESTING PATCH for neutron consumption:"},{"line_number":26,"context_line":"Depends-On: I300323961a35385e597d803348ca2f877ee55fdd"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf659307_a7a3adb1","line":23,"range":{"start_line":22,"start_character":67,"end_line":23,"end_character":16},"in_reply_to":"5f93b717_a7d533e7","updated":"2018-04-03 22:01:22.000000000","message":"https://github.com/openstack/neutron/blob/master/neutron/policy.py#L33","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"}],"neutron_lib/policy.py":[{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"a1baf2da2491868ca284697e443e031f2077fc75","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        f \u003d getattr(directory.get_plugin(), \u0027get_%s\u0027 % resource_type)"},{"line_number":216,"context_line":"        # f *must* exist, if not found it is better to let neutron"},{"line_number":217,"context_line":"        # explode. Check will be performed with admin context"},{"line_number":218,"context_line":"        from neutron_lib import context as _context"},{"line_number":219,"context_line":"        try:"},{"line_number":220,"context_line":"            data \u003d f(_context.get_admin_context(),"},{"line_number":221,"context_line":"                     resource_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_9075d466","line":218,"range":{"start_line":218,"start_character":8,"end_line":218,"end_character":51},"updated":"2018-01-30 18:11:40.000000000","message":"This was added due to a cyclic dependency context \u003c-\u003e policy. Ideally there\u0027s a better solution, but nothing simple came to mind.","commit_id":"ae734e72f30f766cac4e9662d35b9603d653bdbd"}]}
