[TF] Fix issue with missing NetworkIpAvailability extension.
In environment with TungstenFabric and enabled amphora provider.
Related-PROD: PRODX-30528
Change-Id: I63c36c3c23d920f12f4823062990227844f2bf49
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index c48e257..bbf1ba6 100644
--- a/octavia_tempest_plugin/config.py
+++ b/octavia_tempest_plugin/config.py
@@ -15,6 +15,7 @@
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
@@ -304,3 +305,12 @@
'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