[TF] Fix issue with missing NetworkIpAvailability extension.
In environment with TungstenFabric and enabled amphora provider.
Related-PROD: PRODX-30528
Change-Id: I63c36c3c23d920f12f4823062990227844f2bf49
(cherry picked from commit 2f7eee6f505c2ec5d067f2c5ae040e41033e6401)
(cherry picked from commit cea9b6babcb43d98ca58f2b73689df7a8a028864)
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index 0eb773a..44f864c 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
@@ -310,3 +311,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