Files
ovn-octavia-provider/ovn_octavia_provider/common/utils.py
Maciej Józefczyk 000049c15d Move OVN Octavia Provider driver code to this repository
This code moves OVN Octavia provider driver from networking-ovn
(branch master) repository to this repository.

For first step lets move code and unit tests.

Previous paths in networking-ovn tree:
./networking_ovn/octavia/ovn_driver.py -> ./ovn_octavia_provider/driver.py
./networking_ovn/tests/unit/octavia/test_ovn_driver ->
   ./ovn_octavia_provider/tests/unit/test_driver.py

There are a few files taken directly from neutron
repository that could be removed when neutron-lib
including those will be released:
./ovn_octavia_provider/ovsdb/impl_idl_ovn.py
./ovn_octavia_provider/ovsdb/ovsdb_monitor.py

Co-Authored-By: Brian Haley <bhaley@redhat.com>
Co-Authored-By: Carlos Goncalves <cgoncalves@redhat.com>
Co-Authored-By: Frode Nordahl <frode.nordahl@canonical.com>
Co-Authored-By: Jakub Libosvar <libosvar@redhat.com>
Co-Authored-By: Maciej Józefczyk <mjozefcz@redhat.com>
Co-Authored-By: Numan Siddique <nusiddiq@redhat.com>
Co-Authored-By: Reedip Banerjee <rbanerje@redhat.com>
Co-Authored-By: Terry Wilson <twilson@redhat.com>
Co-Authored-By: Yunxiang Tao <taoyunxiang@cmss.chinamobile.com>
Co-Authored-By: zhufl <zhu.fanglei@zte.com.cn>

Change-Id: I9b562c4ed5f74df2c3d600356758f4648ac7770b
Related-Blueprint: neutron-ovn-merge
2020-02-18 16:23:54 +00:00

34 lines
1.4 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from ovn_octavia_provider.common import constants
def ovn_name(id):
# The name of the OVN entry will be neutron-<UUID>
# This is due to the fact that the OVN application checks if the name
# is a UUID. If so then there will be no matches.
# We prefix the UUID to enable us to use the Neutron UUID when
# updating, deleting etc.
return 'neutron-%s' % id
def ovn_lrouter_port_name(id):
# The name of the OVN lrouter port entry will be lrp-<UUID>
# This is to distinguish with the name of the connected lswitch patch port,
# which is named with neutron port uuid, so that OVS patch ports are
# generated properly. The pairing patch port names will be:
# - patch-lrp-<UUID>-to-<UUID>
# - patch-<UUID>-to-lrp-<UUID>
# lrp stands for Logical Router Port
return constants.LRP_PREFIX + '%s' % id