policy file validation errors are hard to debug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.policy |
Fix Released
|
Medium
|
Kseniya Tychkova |
Bug Description
While adding new entries to Ironic's policy.json file, I had a typo in a line, but oslo_policy.
Here's the traceback:
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser [-] Failed to understand rule admin_or_ops
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser Traceback (most recent call last):
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser File "/opt/source/
5/site-
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser kind, match = rule.split(':', 1)
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser ValueError: not enough values to unpack (expected 2, got 1)
2016-06-02 15:16:03.463 24557 ERROR oslo_policy._parser
2016-06-02 15:16:03.464 24557 ERROR oslo_policy._parser [-] Failed to understand rule admin_or_ops
2016-06-02 15:16:03.464 24557 ERROR oslo_policy._parser Traceback (most recent call last):
2016-06-02 15:16:03.464 24557 ERROR oslo_policy._parser File "/opt/source/
5/site-
2016-06-02 15:16:03.464 24557 ERROR oslo_policy._parser kind, match = rule.split(':', 1)
2016-06-02 15:16:03.464 24557 ERROR oslo_policy._parser ValueError: not enough values to unpack (expected 2, got 1)
Here is my policy file. Note the error on the last line, not in the "admin_or_ops" rule.
{
"default": "rule:admin_
"show_
"admin_api": "role:admin or role:administra
"admin_or_ops": "role:admin or role:operator",
"baremetal:
}
Changed in oslo.policy: | |
assignee: | nobody → Kseniya Tychkova (ktychkova) |
Changed in oslo.policy: | |
status: | Fix Committed → Fix Released |
Yes this is a real problem! I was helping devananda with debugging some things and ran across this.