)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"630cf46cbdcb5520f1995fff2eb0a521ac8898fb","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Because we have policy in code, we should be able to use the"},{"line_number":10,"context_line":"oslo.policy CLI scripts to produce sample policy files and render"},{"line_number":11,"context_line":"complete policies based on overrides on disk. This wasn\u0027t working"},{"line_number":12,"context_line":"properly because keystone wasn\u0027t removed unexpected commandline"},{"line_number":13,"context_line":"arguments before passing them to oslo.config to parse. This prevented"},{"line_number":14,"context_line":"people from generating complete policy files like they would for"},{"line_number":15,"context_line":"horizon."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f91af0f_0aec88c5","line":12,"range":{"start_line":12,"start_character":26,"end_line":12,"end_character":52},"updated":"2018-01-03 11:20:13.000000000","message":"nit: I am not english native speaker, so I don\u0027t think that sentence sounds right.","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":11589,"name":"Harry Rybacki","email":"hrybacki@redhat.com","username":"hrybacki"},"change_message_id":"967d93101024da99a7d83184c2f170838833f447","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Because we have policy in code, we should be able to use the"},{"line_number":10,"context_line":"oslo.policy CLI scripts to produce sample policy files and render"},{"line_number":11,"context_line":"complete policies based on overrides on disk. This wasn\u0027t working"},{"line_number":12,"context_line":"properly because keystone wasn\u0027t removed unexpected commandline"},{"line_number":13,"context_line":"arguments before passing them to oslo.config to parse. This prevented"},{"line_number":14,"context_line":"people from generating complete policy files like they would for"},{"line_number":15,"context_line":"horizon."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f91af0f_37f450cf","line":12,"range":{"start_line":12,"start_character":26,"end_line":12,"end_character":40},"updated":"2018-01-03 14:30:09.000000000","message":"s/wasn\u0027t removed/is not removing/","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a86356b960fd4799211e2686184220379a50b860","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Because we have policy in code, we should be able to use the"},{"line_number":10,"context_line":"oslo.policy CLI scripts to produce sample policy files and render"},{"line_number":11,"context_line":"complete policies based on overrides on disk. This wasn\u0027t working"},{"line_number":12,"context_line":"properly because keystone wasn\u0027t removed unexpected commandline"},{"line_number":13,"context_line":"arguments before passing them to oslo.config to parse. This prevented"},{"line_number":14,"context_line":"people from generating complete policy files like they would for"},{"line_number":15,"context_line":"horizon."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f91af0f_fab32d4c","line":12,"range":{"start_line":12,"start_character":26,"end_line":12,"end_character":40},"in_reply_to":"9f91af0f_37f450cf","updated":"2018-01-03 14:59:03.000000000","message":"Done","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"630cf46cbdcb5520f1995fff2eb0a521ac8898fb","unresolved":false,"context_lines":[{"line_number":14,"context_line":"people from generating complete policy files like they would for"},{"line_number":15,"context_line":"horizon."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This commit expose a get_enforcer() method similar to what nova has"},{"line_number":18,"context_line":"done in keystone.common.policy that removes unexpected arguments"},{"line_number":19,"context_line":"passed in from the system before shuffling those off to oslo.config"},{"line_number":20,"context_line":"for a Config object."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f91af0f_cacd405e","line":17,"updated":"2018-01-03 11:20:13.000000000","message":"nit: exposes","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a86356b960fd4799211e2686184220379a50b860","unresolved":false,"context_lines":[{"line_number":14,"context_line":"people from generating complete policy files like they would for"},{"line_number":15,"context_line":"horizon."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This commit expose a get_enforcer() method similar to what nova has"},{"line_number":18,"context_line":"done in keystone.common.policy that removes unexpected arguments"},{"line_number":19,"context_line":"passed in from the system before shuffling those off to oslo.config"},{"line_number":20,"context_line":"for a Config object."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9f91af0f_dab8a92b","line":17,"in_reply_to":"9f91af0f_cacd405e","updated":"2018-01-03 14:59:03.000000000","message":"Done","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"9f87633125f74d3da07a736326fc5e10d1458090","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This commit exposes a get_enforcer() method similar to what nova has"},{"line_number":18,"context_line":"done in keystone.common.policy that ignores unexpected arguments"},{"line_number":19,"context_line":"passed in from the system before shuffling those off to oslo.config"},{"line_number":20,"context_line":"for a Config object."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I22583258eac5b3a64208355d18ccfa62dba1871d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f91af0f_06731c4f","line":19,"updated":"2018-01-03 18:03:36.000000000","message":"This description is a little misleading now.  The end result is the same, but there isn\u0027t actually any processing of the incoming arguments anymore.","commit_id":"0cd15dd0a6514436d07a28fb908169daff7c7a17"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"3836064e36518b2348aabc95d6640871b0b9637a","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This commit exposes a get_enforcer() method similar to what nova has"},{"line_number":18,"context_line":"done in keystone.common.policy that ignores unexpected arguments"},{"line_number":19,"context_line":"passed in from the system before shuffling those off to oslo.config"},{"line_number":20,"context_line":"for a Config object."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I22583258eac5b3a64208355d18ccfa62dba1871d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f91af0f_60c1ab80","line":19,"in_reply_to":"9f91af0f_06731c4f","updated":"2018-01-03 20:40:29.000000000","message":"Good call - I\u0027ll fix this. I\u0027m also proposing a patch to nova so that it does the same thing and it should simplify the processing there too.","commit_id":"0cd15dd0a6514436d07a28fb908169daff7c7a17"}],"keystone/common/policy.py":[{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"f0161cae0b7e0848e6a76e73ff44b59b240a1f94","unresolved":false,"context_lines":[{"line_number":40,"context_line":"def get_enforcer():"},{"line_number":41,"context_line":"    # This method is for use by oslopolicy CLI scripts. Those scripts need the"},{"line_number":42,"context_line":"    # \u0027output-file\u0027 and \u0027namespace\u0027 options, but having those in sys.argv means"},{"line_number":43,"context_line":"    # loading the Nova config options will fail as those are not expected to"},{"line_number":44,"context_line":"    # be present. So we pass in an arg list with those stripped out."},{"line_number":45,"context_line":"    conf_args \u003d []"},{"line_number":46,"context_line":"    # Start at 1 because CONF expects the equivalent of sys.argv[1:]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f91af0f_2172dce6","line":43,"range":{"start_line":43,"start_character":18,"end_line":43,"end_character":22},"updated":"2018-01-03 02:34:05.000000000","message":"Keystone","commit_id":"735dcd0825769b9de9c25a609587169d9eb725e3"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"30ed70c93b3b6b34eeb67e01d3c98d0f9e9311e2","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # This method is for use by oslopolicy CLI scripts. Those scripts need the"},{"line_number":42,"context_line":"    # \u0027output-file\u0027 and \u0027namespace\u0027 options, but having those in sys.argv means"},{"line_number":43,"context_line":"    # loading the Nova config options will fail as those are not expected to"},{"line_number":44,"context_line":"    # be present. So we pass in an arg list with those stripped out."},{"line_number":45,"context_line":"    conf_args \u003d []"},{"line_number":46,"context_line":"    # Start at 1 because CONF expects the equivalent of sys.argv[1:]"},{"line_number":47,"context_line":"    i \u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_fbeb34ad","line":44,"updated":"2018-01-03 13:53:59.000000000","message":"Why does something in keystone load nova configuration options?","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"058b18120c6a303c5f38aab9ed0eeec577ed16e1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # This method is for use by oslopolicy CLI scripts. Those scripts need the"},{"line_number":42,"context_line":"    # \u0027output-file\u0027 and \u0027namespace\u0027 options, but having those in sys.argv means"},{"line_number":43,"context_line":"    # loading the Nova config options will fail as those are not expected to"},{"line_number":44,"context_line":"    # be present. So we pass in an arg list with those stripped out."},{"line_number":45,"context_line":"    conf_args \u003d []"},{"line_number":46,"context_line":"    # Start at 1 because CONF expects the equivalent of sys.argv[1:]"},{"line_number":47,"context_line":"    i \u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_77873811","line":44,"in_reply_to":"9f91af0f_fbeb34ad","updated":"2018-01-03 14:44:05.000000000","message":"Done","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"630cf46cbdcb5520f1995fff2eb0a521ac8898fb","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    i \u003d 1"},{"line_number":48,"context_line":"    while i \u003c len(sys.argv):"},{"line_number":49,"context_line":"        if sys.argv[i].strip(\u0027-\u0027) in [\u0027namespace\u0027, \u0027output-file\u0027]:"},{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_4ac370ee","line":50,"range":{"start_line":50,"start_character":17,"end_line":50,"end_character":18},"updated":"2018-01-03 11:20:13.000000000","message":"Maybe I don\u0027t have a fresh mind, but why skip 2, if we need to filter namespace and outputfile? Are namespace and output-file always provided together with the same order?","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"30ed70c93b3b6b34eeb67e01d3c98d0f9e9311e2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    i \u003d 1"},{"line_number":48,"context_line":"    while i \u003c len(sys.argv):"},{"line_number":49,"context_line":"        if sys.argv[i].strip(\u0027-\u0027) in [\u0027namespace\u0027, \u0027output-file\u0027]:"},{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_7bc2c435","line":50,"range":{"start_line":50,"start_character":17,"end_line":50,"end_character":18},"in_reply_to":"9f91af0f_4ac370ee","updated":"2018-01-03 13:53:59.000000000","message":"It\u0027s skipping the option name (--namespace) and the parameter to the option, isn\u0027t it?","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"058b18120c6a303c5f38aab9ed0eeec577ed16e1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    i \u003d 1"},{"line_number":48,"context_line":"    while i \u003c len(sys.argv):"},{"line_number":49,"context_line":"        if sys.argv[i].strip(\u0027-\u0027) in [\u0027namespace\u0027, \u0027output-file\u0027]:"},{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_37f53084","line":50,"range":{"start_line":50,"start_character":17,"end_line":50,"end_character":18},"in_reply_to":"9f91af0f_7bc2c435","updated":"2018-01-03 14:44:05.000000000","message":"yeah - sys.argv is a list so it is skipping the name and the value:\n\n  [\u0027/usr/local/bin/oslopolicy-policy-generator\u0027, \u0027--namespace\u0027, \u0027keystone\u0027]\n\nHere we\u0027d be removing \u0027namespace\u0027 and \u0027keystone\u0027. I attempted to rewrite this to be more pythonic because I thought this was either a list or a dictionary, but then I realized why the original author wrote it this way.\n\nI\u0027m open to suggestions for making this more clear though.","commit_id":"be6f4e48ab6b013a0adda729e7b88da54e59213f"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"1dd4b11134125f593349f6ff0e802cf8c8856585","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    CONF(conf_args, project\u003d\u0027keystone\u0027)"},{"line_number":56,"context_line":"    init()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f91af0f_5d5a53f3","line":53,"updated":"2018-01-03 15:41:33.000000000","message":"Will this logic ever result in any useful values being passed in? Why not just pass an empty list?","commit_id":"e226e18ef7ec3011bdd3af6ffa8b160ba7ab94f4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"18f4cbe46bcc3ba8f1ba4452d906088d4c9115f6","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    CONF(conf_args, project\u003d\u0027keystone\u0027)"},{"line_number":56,"context_line":"    init()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f91af0f_a00578c4","line":53,"in_reply_to":"9f91af0f_4046ec23","updated":"2018-01-03 16:30:55.000000000","message":"That makes sense and I think it justifies just passing an empty list to avoid this logic. I\u0027ll push up a new patch.","commit_id":"e226e18ef7ec3011bdd3af6ffa8b160ba7ab94f4"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"2992e8be7aa8efd8b2db1d947057fd004764c97c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    CONF(conf_args, project\u003d\u0027keystone\u0027)"},{"line_number":56,"context_line":"    init()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f91af0f_dd2183fd","line":53,"in_reply_to":"9f91af0f_5d5a53f3","updated":"2018-01-03 15:57:31.000000000","message":"That was my thought after I realized why the logic looked the way it did. The only other options that would be passed through from oslopolicy-policy-generator would be --config-dir and --config-file, but keystone shouldn\u0027t choke on those since it should expect them anyway...\n\nThat said, should we just pass an empty list and not allow option via the command line?","commit_id":"e226e18ef7ec3011bdd3af6ffa8b160ba7ab94f4"},{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"3d47176a8f5fca2d3668ef90d1869d49ac5ec9bd","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    CONF(conf_args, project\u003d\u0027keystone\u0027)"},{"line_number":56,"context_line":"    init()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f91af0f_fd29e79a","line":53,"in_reply_to":"9f91af0f_dd2183fd","updated":"2018-01-03 16:12:43.000000000","message":"No, lets keep the ability to handle CLI arguments explicitly.  We may well end up with them in the long run.","commit_id":"e226e18ef7ec3011bdd3af6ffa8b160ba7ab94f4"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ff09adcdfbe58b6df5236a45b892307d33c80fd8","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            i +\u003d 2"},{"line_number":51,"context_line":"            continue"},{"line_number":52,"context_line":"        conf_args.append(sys.argv[i])"},{"line_number":53,"context_line":"        i +\u003d 1"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    CONF(conf_args, project\u003d\u0027keystone\u0027)"},{"line_number":56,"context_line":"    init()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f91af0f_4046ec23","line":53,"in_reply_to":"9f91af0f_fd29e79a","updated":"2018-01-03 16:27:27.000000000","message":"Because of the way this function is invoked the only command line options that will ever be supported will also need to be supported by the program in oslo.policy that is calling this function. Said another way, it is not possible to have command line arguments understood by this function that are not understood by oslopolicy-sample-generator as well. All of the entry points in the other oslo libraries are designed to be invoked without command line argument processing for that reason.","commit_id":"e226e18ef7ec3011bdd3af6ffa8b160ba7ab94f4"}]}
