← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1659031] [NEW] FWaaS - Cannot specify 8bit integer for 'protocol' in firewall_rule

 

Public bug reported:

In current FWaaS, we cannot specify integer value for 'protocol' in
firewall_rule.

[How to reproduce]
$source devstack/openrc admin admin
$export TOKEN=`openstack token issue| grep ' id ' | get_field 2`

$curl -X POST -d '{"firewall_rule":{"name":"test", "protocol": "6",
"action": "deny"}}' -H "x-auth-token:$TOKEN"
192.168.122.253:9696/v2.0/fwaas/firewall_rules

{"NeutronError": {"message": "Invalid input for protocol. Reason: 6 is
not in valid_values.", "type": "HTTPBadRequest", "detail": ""}}

$curl -X POST -d '{"firewall_rule":{"name":"test", "protocol": 6,
"action": "deny"}}' -H "x-auth-token:$TOKEN"
192.168.122.253:9696/v2.0/fwaas/firewall_rules

{"NeutronError": {"message": "Request Failed: internal server error
while processing your request.", "type": "HTTPInternalServerError",
"detail": ""}}


[q-svc.log]
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource Traceback (most recent call last):
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     result = method(request=request, **args)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 438, in create
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return self._create(request, body, **kwargs)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     setattr(e, '_RETRY_EXCEEDED', True)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     traceback.format_exc())
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*dup_args, **dup_kwargs)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 447, in _create
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     allow_bulk=self._allow_bulk)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 727, in prepare_request_body
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     attributes.convert_value(attr_info, res_dict, webob.exc.HTTPBadRequest)
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/attributes.py", line 325, in convert_value
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     res_dict[attr] = attr_vals['convert_to'](res_dict[attr])
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron-fwaas/neutron_fwaas/extensions/firewall.py", line 179, in convert_protocol
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     if value.isdigit():
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource AttributeError: 'int' object has no attribute 'isdigit'
2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: fwaas

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1659031

Title:
  FWaaS - Cannot specify 8bit integer for 'protocol' in firewall_rule

Status in neutron:
  New

Bug description:
  In current FWaaS, we cannot specify integer value for 'protocol' in
  firewall_rule.

  [How to reproduce]
  $source devstack/openrc admin admin
  $export TOKEN=`openstack token issue| grep ' id ' | get_field 2`

  $curl -X POST -d '{"firewall_rule":{"name":"test", "protocol": "6",
  "action": "deny"}}' -H "x-auth-token:$TOKEN"
  192.168.122.253:9696/v2.0/fwaas/firewall_rules

  {"NeutronError": {"message": "Invalid input for protocol. Reason: 6 is
  not in valid_values.", "type": "HTTPBadRequest", "detail": ""}}

  $curl -X POST -d '{"firewall_rule":{"name":"test", "protocol": 6,
  "action": "deny"}}' -H "x-auth-token:$TOKEN"
  192.168.122.253:9696/v2.0/fwaas/firewall_rules

  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}

  
  [q-svc.log]
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 438, in create
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return self._create(request, body, **kwargs)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     setattr(e, '_RETRY_EXCEEDED', True)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     ectxt.value = e.inner_exc
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*args, **kwargs)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     traceback.format_exc())
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     self.force_reraise()
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     return f(*dup_args, **dup_kwargs)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 447, in _create
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     allow_bulk=self._allow_bulk)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 727, in prepare_request_body
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     attributes.convert_value(attr_info, res_dict, webob.exc.HTTPBadRequest)
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/attributes.py", line 325, in convert_value
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     res_dict[attr] = attr_vals['convert_to'](res_dict[attr])
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource   File "/opt/stack/neutron-fwaas/neutron_fwaas/extensions/firewall.py", line 179, in convert_protocol
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource     if value.isdigit():
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource AttributeError: 'int' object has no attribute 'isdigit'
  2017-01-25 00:25:13.517 TRACE neutron.api.v2.resource

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1659031/+subscriptions


Follow ups