Rule creation with congress_noauth fails

Bug #1433745 reported by Tim Hinrichs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
Medium
Amey Bhide

Bug Description

$ ./congress_noauth policy rule create classification 'error(x) :- q(x)'
usage: openstack congress policy rule create [-h]
                                             [-f {html,json,shell,table,value,yaml}]
                                             [-c COLUMN]
                                             [--max-width <integer>]
                                             [--prefix PREFIX]
                                             [--name RULE_NAME]
                                             <policy-name> <rule>
openstack congress policy rule create: error: unrecognized arguments: :- q(x)

Amey Bhide (abhide)
Changed in congress:
assignee: nobody → Amey Bhide (abhide)
Revision history for this message
Amey Bhide (abhide) wrote :

 "" around rule get removed when we try to interpret them as positional parameters in bash

Need to escape double-quotes

See the difference:

./congress_noauth policy rule create test_policy1 "a(x) :- b(x)"
openstack --os-token foo --os-url http://127.0.0.1:1789 congress policy rule create test_policy1 a(x) :- b(x)

./congress_noauth policy rule create test_policy1 "\"a(x) :- b(x)\""
openstack --os-token foo --os-url http://127.0.0.1:1789 congress policy rule create test_policy1 "a(x) :- b(x)"

Revision history for this message
Amey Bhide (abhide) wrote :

Executing command in this manner work:

openstack --os-token foo --os-url http://127.0.0.1:1789
(openstack) congress policy rule create test_policy1 "a(x) :- b(x)"
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| comment | None |
| id | ed0c17a7-ef25-4418-a42c-314e5cbd9e46 |
| name | None |
| rule | a(x) :- |
| | b(x) |
+---------+--------------------------------------+

Amey Bhide (abhide)
Changed in congress:
status: New → In Progress
Revision history for this message
Amey Bhide (abhide) wrote :
Tim Hinrichs (thinrichs)
Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → kilo-3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.