Browse Source

Fixes URL path for SFC v2 Driver

Due to this fix https://review.openstack.org/#/c/496388/,
now URL for OpenDaylight driver is not created correctly.

Correct url has format

http://<hostname>/controller/nb/v2/neutron/sfc/portpairs

Now it produces

http://<hostname>/controller/nb/v2/neutron/sfc/port-pairs

Closes-Bug: 1724644
Partial-bug: #1713697
Duplicate-patch: https://review.openstack.org/#/c/512951/

Change-Id: Ie4a75323694c69aaa5e682890647beaf461b6888
Signed-off-by: Tim Rozet <trozet@redhat.com>
Co-Authored-By: Rajiv Kumar <rajiv.kumar@nectechnologies.in>
(cherry picked from commit 7366ac0455)
tags/11.0.1
Tim Rozet 3 years ago
committed by Michel Peterson
parent
commit
ab4c69a472
3 changed files with 17 additions and 1 deletions
  1. +7
    -1
      networking_odl/common/constants.py
  2. +6
    -0
      networking_odl/tests/unit/common/test_utils.py
  3. +4
    -0
      releasenotes/notes/fix-sfcv2-urlpath-f339357bed1a538c.yaml

+ 7
- 1
networking_odl/common/constants.py View File

@@ -94,4 +94,10 @@ COMPLETED = 'completed'
BEFORE_COMPLETE = 'before_complete'

# dict to store url mappings
RESOURCE_URL_MAPPINGS = {ODL_QOS_POLICY: "%s/%s" % (ODL_QOS, ODL_QOS_POLICIES)}
RESOURCE_URL_MAPPINGS = {
ODL_QOS_POLICY: "%s/%s" % (ODL_QOS, ODL_QOS_POLICIES),
ODL_SFC_FLOW_CLASSIFIER: "%s/%s" % (ODL_SFC, ODL_SFC_FLOW_CLASSIFIERS),
ODL_SFC_PORT_CHAIN: "%s/%s" % (ODL_SFC, ODL_SFC_PORT_CHAINS),
ODL_SFC_PORT_PAIR: "%s/%s" % (ODL_SFC, ODL_SFC_PORT_PAIRS),
ODL_SFC_PORT_PAIR_GROUP: "%s/%s" % (ODL_SFC, ODL_SFC_PORT_PAIR_GROUPS)
}

+ 6
- 0
networking_odl/tests/unit/common/test_utils.py View File

@@ -34,6 +34,12 @@ class TestUtils(base.DietTestCase):
url_object = utils.make_url_object('policy')
self.assertEqual('qos/policies', url_object)

def test_make_url_sfc_object_in_resource_map(self):
objs = ['flowclassifier', 'portpair', 'portpairgroup', 'portchain']
for obj in objs:
url_object = utils.make_url_object(obj)
self.assertEqual('sfc/%ss' % obj, url_object)

def test_make_url_object_conversion(self):
self.assertEqual('networks', utils.make_url_object('network'))
self.assertEqual('l2-gateways', utils.make_url_object('l2_gateway'))


+ 4
- 0
releasenotes/notes/fix-sfcv2-urlpath-f339357bed1a538c.yaml View File

@@ -0,0 +1,4 @@
---
fixes:
- |
Fixes ODL Neutron NB URL path for SFC v2 Driver.

Loading…
Cancel
Save