Merge "Fix exception when api_extensions is set to empty"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 8a7ad9c..ad5ee61 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -391,12 +391,14 @@
 
 # A list of enabled compute extensions with a special entry
 # all which indicates every extension is enabled. Each
-# extension should be specified with alias name (list value)
+# extension should be specified with alias name. Empty list
+# indicates all extensions are disabled (list value)
 #api_extensions=all
 
 # A list of enabled v3 extensions with a special entry all
 # which indicates every extension is enabled. Each extension
-# should be specified with alias name (list value)
+# should be specified with alias name. Empty list indicates
+# all extensions are disabled (list value)
 #api_v3_extensions=all
 
 # Does the test environment support changing the admin
@@ -750,7 +752,8 @@
 #ipv6=true
 
 # A list of enabled network extensions with a special entry
-# all which indicates every extension is enabled (list value)
+# all which indicates every extension is enabled. Empty list
+# indicates all extensions are disabled (list value)
 #api_extensions=all
 
 # Allow the execution of IPv6 subnet tests that use the
@@ -1105,7 +1108,8 @@
 #snapshot=true
 
 # A list of enabled volume extensions with a special entry all
-# which indicates every extension is enabled (list value)
+# which indicates every extension is enabled. Empty list
+# indicates all extensions are disabled (list value)
 #api_extensions=all
 
 # Is the v1 volume API enabled (boolean value)
diff --git a/tempest/config.py b/tempest/config.py
index c83f500..851d8c1 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -268,12 +268,14 @@
                 default=['all'],
                 help='A list of enabled compute extensions with a special '
                      'entry all which indicates every extension is enabled. '
-                     'Each extension should be specified with alias name'),
+                     'Each extension should be specified with alias name. '
+                     'Empty list indicates all extensions are disabled'),
     cfg.ListOpt('api_v3_extensions',
                 default=['all'],
                 help='A list of enabled v3 extensions with a special entry all'
                      ' which indicates every extension is enabled. '
-                     'Each extension should be specified with alias name'),
+                     'Each extension should be specified with alias name. '
+                     'Empty list indicates all extensions are disabled'),
     cfg.BoolOpt('change_password',
                 default=False,
                 help="Does the test environment support changing the admin "
@@ -441,7 +443,8 @@
     cfg.ListOpt('api_extensions',
                 default=['all'],
                 help='A list of enabled network extensions with a special '
-                     'entry all which indicates every extension is enabled'),
+                     'entry all which indicates every extension is enabled. '
+                     'Empty list indicates all extensions are disabled'),
     cfg.BoolOpt('ipv6_subnet_attributes',
                 default=False,
                 help="Allow the execution of IPv6 subnet tests that use "
@@ -546,7 +549,8 @@
     cfg.ListOpt('api_extensions',
                 default=['all'],
                 help='A list of enabled volume extensions with a special '
-                     'entry all which indicates every extension is enabled'),
+                     'entry all which indicates every extension is enabled. '
+                     'Empty list indicates all extensions are disabled'),
     cfg.BoolOpt('api_v1',
                 default=True,
                 help="Is the v1 volume API enabled"),
diff --git a/tempest/test.py b/tempest/test.py
index afe7a96..5b7330b 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -215,6 +215,8 @@
         'network': CONF.network_feature_enabled.api_extensions,
         'object': CONF.object_storage_feature_enabled.discoverable_apis,
     }
+    if len(config_dict[service]) == 0:
+        return False
     if config_dict[service][0] == 'all':
         return True
     if extension_name in config_dict[service]: