Unify checks for TF backend
Method of checking already presented in the tempest.
We can only reuse it.
Related-Prod: PRODX-37464
Change-Id: I5e75582081843a0530094c4f2ee0ce32360b31c0
(cherry picked from commit 7fcab05728f4cefdb2691df983444d2c204c0eeb)
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index 0587a5c..58ddf13 100644
--- a/octavia_tempest_plugin/config.py
+++ b/octavia_tempest_plugin/config.py
@@ -15,7 +15,6 @@
from oslo_config import cfg
from oslo_log import log as logging
-from tempest import config
from octavia_tempest_plugin.common import constants as const
@@ -311,12 +310,3 @@
'scope? This configuration value should be same as '
'octavia.conf: [oslo_policy].enforce_scope option.'),
]
-
-
-def is_tungstenfabric_backend_enabled():
- """Return True if TungstenFabric is used as a backend."""
- try:
- sdn = getattr(config.CONF, 'sdn')
- return getattr(sdn, 'service_name', None) == 'tungstenfabric'
- except cfg.NoSuchOptError:
- return False
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index e758be3..55e4d1b 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -34,7 +34,6 @@
from octavia_tempest_plugin.common import cert_utils
from octavia_tempest_plugin.common import constants as const
-from octavia_tempest_plugin import config as config_octavia
from octavia_tempest_plugin.tests import RBAC_tests
from octavia_tempest_plugin.tests import validators
from octavia_tempest_plugin.tests import waiters
@@ -875,7 +874,7 @@
cls.webserver2_public_ip))
if (CONF.load_balancer.test_with_ipv6 and not
- config_octavia.is_tungstenfabric_backend_enabled()):
+ config.is_tungstenfabric_backend_enabled()):
# Enable the IPv6 nic in webserver 1
cls._enable_ipv6_nic_webserver(
cls.webserver1_public_ip, cls.lb_member_keypair['private_key'],
@@ -1055,7 +1054,7 @@
network_id=network['id'],
mac_address=instance_network[0]['OS-EXT-IPS-MAC:mac_addr'])
port_id = result['ports'][0]['id']
- if config_octavia.is_tungstenfabric_backend_enabled():
+ if config.is_tungstenfabric_backend_enabled():
port = result['ports'][0]
fixed_ip = None
for ip in port["fixed_ips"]: