Ask Your Question
0

A part of network's name will be lost

asked 2013-06-19 04:13:15 -0500

I use the latest code of Grizzly, and create a network. The name of network is longer then 255 characters. Then I list networks, the name of network has only 255 characters. This is my request: { "network": { "name": "test12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" } }

And this is list network responce: { "networks": [ { "status": "ACTIVE", "subnets": [], "name": "test12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", "provider:physical_network": "physnet1", "admin_state_up": true, "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "provider:network_type": "vlan", "router:external": false, "shared": false, "id": "40a59f54-d8c0-432c-a2ef-6a8151348054", "provider:segmentation_id": 54 } ] }

The name lost 9 characters.

I found the code in /quantum/db/models_v2.py

class Network(model_base.BASEV2, HasId, HasTenant): """Represents a v2 quantum network.""" name = sa.Column(sa.String(255)) ports = orm.relationship(Port, backref='networks') subnets = orm.relationship(Subnet, backref='networks') status = sa.Column(sa.String(16)) admin_state_up = sa.Column(sa.Boolean) shared = sa.Column(sa.Boolean)

It defines ths name's limit is 255 characters. But there is no parameter check when create network.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-06-19 04:21:14 -0500

looks like it gets truncated. The api layer should probably raise an exception if >255 chars.

edit flag offensive delete link more
0

answered 2013-06-24 01:19:32 -0500

Thanks Aaron Rosen, that solved my question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-06-19 04:13:15 -0500

Seen: 8 times

Last updated: Jun 24 '13