Comment 1 for bug 1788045

Revision history for this message
Hongbin Lu (hongbin.lu) wrote :

Hi @James,

If I reproduced this issue correct, this doesn't seem to be a neutron bug. In below, I tried to create a security group rule with unicode character. The trace indicated that the error was raised in client side:

  $ RULE_ID=$(openstack security group rule create --protocol "icmp" --remote-ip "0.0.0.0/0" --description "ICMP Ping”" default -c id -f value)

  $ openstack security group rule delete $RULE_ID
  Failed to delete rule with name or ID '576a8d9b-c5db-47aa-bb16-873071ed3f8a': 'ascii' codec can't encode
  character u'\u201d' in position 136: ordinal not in range(128)
  1 of 1 rules failed to delete.

  $ openstack --debug security group rule delete $RULE_ID
  ...
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/shell.py", line 134, in run
      ret_val = super(OpenStackShell, self).run(argv)
    File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 279, in run
      result = self.run_subcommand(remainder)
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/shell.py", line 169, in run_subcommand
      ret_value = super(OpenStackShell, self).run_subcommand(argv)
    File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 400, in run_subcommand
      result = cmd.run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/osc_lib/command/command.py", line 41, in run
      return super(Command, self).run(parsed_args)
    File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 184, in run
      return_code = self.take_action(parsed_args) or 0
    File "/usr/local/lib/python2.7/dist-packages/openstackclient/network/common.py", line 120, in take_action
      raise exceptions.CommandError(msg)
  CommandError: 1 of 1 rules failed to delete.

If I directly delete it through REST API, it worked:

  $ curl -i -X DELETE -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"
  "http://10.0.0.15:9696/v2.0/security-group-rules/$RULE_ID"
  HTTP/1.1 204 No Content
  X-Openstack-Request-Id: req-b042e293-2b00-4a45-a19f-f50566e236af
  Content-Length: 0
  Date: Tue, 21 Aug 2018 19:16:58 GMT