fuel-client failing to specify neutron segmentation type raises traceback

Bug #1317702 reported by Andrew Woodward
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Artem Roma

Bug Description

{"build_id": "2014-05-08_01-10-31", "mirantis": "yes", "build_number": "188", "ostf_sha": "fe718434f88f2ab167779770828a195f06eb29f8", "nailgun_sha": "82b9d42a7a5e9aa1caf6b2779c45ca045cad0ad2", "production": "docker", "api": "1.0", "fuelmain_sha": "97d7f6d5461db3afc27f58160cf9f6985230d255", "astute_sha": "9c83d3ecec69df03cd94620e2df92249ba4ec786", "release": "5.0", "fuellib_sha": "fd31d9a8f85136347b60377df00df6728eda14ca"}

steps to reproduce:
1. deploy fuel
2. attempt to create cluster with malformed creation string "fuel env create --name aaub-ha-neu-vlan --mode ha --net neutron --nsd vlan --release 2"

result: Insert is sent all the way to DB and causes traceback and 500 error
expected result: client should ensure that required agument was passed, lower but also expected, should know that --nsd is not a valid option for this command

014-05-09 00:12:41 ERROR
[7f2ffe1fc700] (logger) Response code '500 Internal Server Error' for POST /api/v1/clusters/ from 172.17.42.1:35884
2014-05-09 00:12:41 ERROR
[7f2ffe1fc700] (logger) Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/lib/python2.6/site-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "<string>", line 2, in POST
  File "/usr/lib/python2.6/site-packages/nailgun/api/handlers/base.py", line 95, in content_json
    data = func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/nailgun/api/handlers/base.py", line 325, in POST
    new_obj = self.collection.create(data)
  File "/usr/lib/python2.6/site-packages/nailgun/objects/base.py", line 291, in create
    return cls.single.create(data)
  File "/usr/lib/python2.6/site-packages/nailgun/objects/cluster.py", line 176, in create
    create_network_groups_and_config(new_cluster, data)
  File "/usr/lib/python2.6/site-packages/nailgun/network/manager.py", line 1081, in create_network_groups_and_config
    data.get('net_segment_type'))
  File "/usr/lib/python2.6/site-packages/nailgun/network/neutron.py", line 36, in create_neutron_config
    db().flush()
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1718, in flush
    self._flush(objects)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 1789, in _flush
    flush_context.execute()
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 331, in execute
    rec.execute(self)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/unitofwork.py", line 475, in execute
    uow
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
    table, insert)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/persistence.py", line 530, in _emit_insert_statements
    execute(statement, multiparams)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1449, in execute
    params)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
    context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
    context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 331, in do_execute
    cursor.execute(statement, parameters)
ProgrammingError: (ProgrammingError) column "segmentation_type" is of type segmentation_type but expression is of type boolean
LINE 1: ...e:00:00:00', '192.168.111.0/24', '192.168.111.1', false, 'ov...
                                                             ^
HINT: You will need to rewrite or cast the expression.
 'INSERT INTO neutron_config (id, vlan_range, gre_id_range, base_mac, internal_cidr, internal_gateway, segmentation_type, net_l23_provider) VALUES (%(id)s, %(vlan_range)s, %(gre_id_range)s, %(base_mac)s, %(internal_cidr)s, %(internal_gateway)s, %(segmentation_type)s, %(net_l23_provider)s)' {'internal_cidr': u'192.168.111.0/24', 'internal_gateway': u'192.168.111.1', 'net_l23_provider': 'ovs', 'base_mac': u'fa:16:3e:00:00:00', 'gre_id_range': '[2, 65535]', 'vlan_range': '[1000, 1030]', 'segmentation_type': False, 'id': 5}

Dima Shulyak (dshulyak)
tags: added: low-hanging-fruit
Dima Shulyak (dshulyak)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Artem Roma (aroma-x)
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/106014

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/106014
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=5019c62a97355329ddd95029119119a658887651
Submitter: Jenkins
Branch: master

commit 5019c62a97355329ddd95029119119a658887651
Author: Artem Roma <email address hidden>
Date: Thu Jul 10 13:59:28 2014 +0300

    Checking of network segmentation parameter added

    Now one must supply `--net-segment-type` option if he/she is going to
    create environment with neutron network provider.

    Change-Id: I89d57dd8da6b6f8618a43dda4e5b705bf580c5ca
    Closes-Bug: #1317702

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.

Other bug subscribers

Remote bug watches

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