API don't return error for incorrect network configuration

Bug #1404821 reported by Sergey Galkin
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Ihor Kalnytskyi

Bug Description

api: '1.0'
astute_sha: 16b252d93be6aaa73030b8100cf8c5ca6a970a91
auth_required: true
build_id: 2014-12-18_01-32-01
build_number: '56'
feature_groups:
- mirantis
fuellib_sha: 73332192a257ea02c40a39885c502ad1ebdf3eda
fuelmain_sha: 45caacadb878abfbd9d60e134d72229698b469c9
nailgun_sha: 5f91157daa6798ff522ca9f6d34e7e135f150a90
ostf_sha: a9afb68710d809570460c29d6c3293219d3624d4
production: docker

Steps to reproduce
1. Try to create cluster through API
2. post incorrect network settings through API
on example

python.http - DEBUG - PUT {u'networking_parameters': {u'internal_gateway': u'192.168.111.1', u'dns_nameservers': [u'8.8.4.4', u'8.8.8.8'], u'floating_ranges': [[u'172.16.0.130', u'172.16.0.254']], u'net_l23_provider': u'ovs', u'base_mac': u'fa:16:3e:00:00:00', u'internal_cidr': '192.168.111.0/22', u'gre_id_range': [2, 65535], u'vlan_range': [1000, 1030], u'segmentation_type': u'gre'}, u'management_vip': u'192.168.0.1', u'networks': [{'network_size': 22, u'name': u'public', u'ip_ranges': [['172.16.44.16', '172.16.44.220']], u'gateway': '172.16.44.1', 'netmask': '255.255.252.0', u'meta': {u'name': u'public', u'notation': u'ip_ranges', u'render_type': None, u'assign_vip': True, u'map_priority': 1, u'floating_range_var': u'floating_ranges', u'use_gateway': True, u'vlan_start': None, u'render_addr_mask': u'public', u'cidr': u'172.16.0.0/24', u'configurable': True, u'ip_range': [u'172.16.0.2', u'172.16.0.126']}, u'vlan_start': None, u'cidr': '172.16.44.0/22', u'group_id': 1, u'id': 2}, {u'name': u'management', u'ip_ranges': [[u'192.168.0.1', u'192.168.0.254']], u'gateway': None, u'meta': {u'name': u'management', u'notation': u'cidr', u'render_type': u'cidr', u'assign_vip': True, u'map_priority': 2, u'use_gateway': False, u'vlan_start': 101, u'render_addr_mask': u'internal', u'cidr': u'192.168.0.0/24', u'configurable': True}, u'vlan_start': 100, u'cidr': u'192.168.0.0/24', u'group_id': 1, u'id': 3}, {u'name': u'storage', u'ip_ranges': [[u'192.168.1.1', u'192.168.1.254']], u'gateway': None, u'meta': {u'name': u'storage', u'notation': u'cidr', u'render_type': u'cidr', u'assign_vip': False, u'map_priority': 2, u'use_gateway': False, u'vlan_start': 102, u'render_addr_mask': u'storage', u'cidr': u'192.168.1.0/24', u'configurable': True}, u'vlan_start': 101, u'cidr': u'192.168.1.0/24', u'group_id': 1, u'id': 4}, {u'name': u'fuelweb_admin', u'ip_ranges': [[u'10.20.1.1', u'10.20.1.254']], u'gateway': None, u'meta': {u'notation': u'ip_ranges', u'render_type': None, u'assign_vip': False, u'configurable': False, u'unmovable': True, u'use_gateway': True, u'render_addr_mask': None, u'map_priority': 0}, u'vlan_start': None, u'cidr': u'10.20.0.0/16', u'group_id': None, u'id': 1}], u'public_vip': u'172.16.0.2'}

to http://fuel:8000/api/clusters/1/network_configuration/neutron

Expected behavior:
Post return HTTP error code

Actual behavior:
Request return non error HTTP code and set network settings to default

Revision history for this message
Sergey Galkin (sgalkin) wrote :

example of correct request
python.http - DEBUG - PUT {u'networking_parameters': {u'internal_gateway': u'192.168.111.1', u'dns_nameservers': [u'8.8.4.4', u'8.8.8.8'], u'floating_ranges': [['172.16.44.221', '172.16.45.100']], u'net_l23_provider': u'ovs', u'base_mac': u'fa:16:3e:00:00:00', u'internal_cidr': '192.168.111.0/22', u'gre_id_range': [2, 65535], u'vlan_range': [1000, 1030], u'segmentation_type': u'gre'}, u'management_vip': u'192.168.0.1', u'networks': [{'network_size': 22, u'name': u'public', u'ip_ranges': [['172.16.44.16', '172.16.44.220']], u'gateway': '172.16.44.1', 'netmask': '255.255.252.0', u'meta': {u'name': u'public', u'notation': u'ip_ranges', u'render_type': None, u'assign_vip': True, u'map_priority': 1, u'floating_range_var': u'floating_ranges', u'use_gateway': True, u'vlan_start': None, u'render_addr_mask': u'public', u'cidr': u'172.16.0.0/24', u'configurable': True, u'ip_range': [u'172.16.0.2', u'172.16.0.126']}, u'vlan_start': None, u'cidr': '172.16.44.0/22', u'group_id': 1, u'id': 2}, {u'name': u'management', u'ip_ranges': [[u'192.168.0.1', u'192.168.0.254']], u'gateway': None, u'meta': {u'name': u'management', u'notation': u'cidr', u'render_type': u'cidr', u'assign_vip': True, u'map_priority': 2, u'use_gateway': False, u'vlan_start': 101, u'render_addr_mask': u'internal', u'cidr': u'192.168.0.0/24', u'configurable': True}, u'vlan_start': 100, u'cidr': u'192.168.0.0/24', u'group_id': 1, u'id': 3}, {u'name': u'storage', u'ip_ranges': [[u'192.168.1.1', u'192.168.1.254']], u'gateway': None, u'meta': {u'name': u'storage', u'notation': u'cidr', u'render_type': u'cidr', u'assign_vip': False, u'map_priority': 2, u'use_gateway': False, u'vlan_start': 102, u'render_addr_mask': u'storage', u'cidr': u'192.168.1.0/24', u'configurable': True}, u'vlan_start': 101, u'cidr': u'192.168.1.0/24', u'group_id': 1, u'id': 4}, {u'name': u'fuelweb_admin', u'ip_ranges': [[u'10.20.1.1', u'10.20.1.254']], u'gateway': None, u'meta': {u'notation': u'ip_ranges', u'render_type': None, u'assign_vip': False, u'configurable': False, u'unmovable': True, u'use_gateway': True, u'render_addr_mask': None, u'map_priority': 0}, u'vlan_start': None, u'cidr': u'10.20.0.0/16', u'group_id': None, u'id': 1}], u'public_vip': u'172.16.0.2'}
to http://fuel:8000/api/clusters/1/network_configuration/neutron

description: updated
Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
importance: Undecided → Medium
milestone: none → 6.1
Changed in fuel:
status: New → Confirmed
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Igor Kalnitsky (ikalnitsky)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/143667

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/143667
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=b73cde1c05eb3863f043fd587f5c555f341b027d
Submitter: Jenkins
Branch: master

commit b73cde1c05eb3863f043fd587f5c555f341b027d
Author: Igor Kalnitsky <email address hidden>
Date: Tue Dec 23 15:15:06 2014 +0200

    Return error HTTP code for incorrect neutron conf

    Recently, we used to return error message for incorrect neutron config
    without error HTTP status code. In other words, the "202 Accepted" was
    always returned regardless it was successful or not.

    Since now, tbe "400 Bad Request" will be returned in case of error and
    "200 OK" in case of success (there's no reason to return "202 Accepted"
    for synchronous task).

    Change-Id: I9ad16fceb930332b427773dec32bd84d30fb1fd3
    Closes-Bug: #1404821

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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