[VNC API server] Intensively use replace('-', '_')

Bug #1586327 reported by Édouard Thuleau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Unassigned
OpenContrail
New
Undecided
Unassigned

Bug Description

The VNC API code use intensively the string method 'replace' to replace dash by underscore in the resource type.

Tags: config
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/20704
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/20921
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/20704
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/20921
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/20704
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/20921
Committed: http://github.org/Juniper/contrail-generateDS/commit/db223c2021517360086f4bfc465994b69aac2925
Submitter: Zuul
Branch: master

commit db223c2021517360086f4bfc465994b69aac2925
Author: Édouard Thuleau <email address hidden>
Date: Thu Jun 2 15:12:35 2016 +0200

Distinguish resource type with dash to underscore

That fix introduce a distinction between resource type name with dash
to resource type name with underscore in order to not have to replace
dash by underscore and conversely. Dash version is principally use in
the rest API and in the ifmap graph, underscore one is used in code and
in database.
That patch adds a new list of tuples that contains all resource types in
both way (underscore and dash) named 'all_resource_type_tuples'. It
does not change the already existing list 'all_resource_types' to not
break compatibility until I8802a668b60cf173c11787ed86233b393a59ae1e was
merged.

Partial-bug: #1586327
Change-Id: I535aabe08a2230e3b7c0e08b9d59472fdd1e3b7c

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/20704
Submitter: Édouard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/20704
Submitter: ?douard Thuleau (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/20704
Committed: http://github.org/Juniper/contrail-controller/commit/40439b4924f3d57f03104d022629857b15536864
Submitter: Zuul
Branch: master

commit 40439b4924f3d57f03104d022629857b15536864
Author: Édouard Thuleau <email address hidden>
Date: Fri May 27 10:32:28 2016 +0200

[VNC API server] Remove intensive use of string replace method

The VNC API have to translate resource type dash per an underscore.
But that replacing stuff appears redundantly in the code. That fix
removes useless calls to 'replace('-', '_')' and ensures that correctly
translated when it came from the rest API.
It uses the new class attributes introduced by
I535aabe08a2230e3b7c0e08b9d59472fdd1e3b7c to get underscore and bash
version of the type.

Closes-Bug: #1586327
Depends-On: I535aabe08a2230e3b7c0e08b9d59472fdd1e3b7c
Change-Id: I8802a668b60cf173c11787ed86233b393a59ae1e

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.