Merge "Avoid using len(x)
to check if x is empty"
This commit is contained in:
commit
e4c39f69a2
@ -78,7 +78,7 @@ class _CryptoPluginManager(named.NamedExtensionManager):
|
||||
"""
|
||||
active_plugins = plugin_utils.get_active_plugins(self)
|
||||
|
||||
if len(active_plugins) < 1:
|
||||
if not active_plugins:
|
||||
raise crypto.CryptoPluginNotFound()
|
||||
|
||||
for generating_plugin in active_plugins:
|
||||
@ -99,7 +99,7 @@ class _CryptoPluginManager(named.NamedExtensionManager):
|
||||
"""
|
||||
active_plugins = plugin_utils.get_active_plugins(self)
|
||||
|
||||
if len(active_plugins) < 1:
|
||||
if not active_plugins:
|
||||
raise crypto.CryptoPluginNotFound()
|
||||
|
||||
for decrypting_plugin in active_plugins:
|
||||
|
@ -743,7 +743,7 @@ class _CertificateEventPluginManager(named.NamedExtensionManager,
|
||||
"""Invoke same function on plugins as calling function."""
|
||||
active_plugins = plugin_utils.get_active_plugins(self)
|
||||
|
||||
if len(active_plugins) < 1:
|
||||
if not active_plugins:
|
||||
raise CertificateEventPluginNotFound()
|
||||
|
||||
for plugin in active_plugins:
|
||||
|
@ -477,7 +477,7 @@ class SecretStoreBase(object):
|
||||
|
||||
def _enforce_extensions_configured(plugin_related_function):
|
||||
def _check_plugins_configured(self, *args, **kwargs):
|
||||
if len(self.extensions) < 1:
|
||||
if not self.extensions:
|
||||
raise SecretStorePluginsNotConfigured()
|
||||
return plugin_related_function(self, *args, **kwargs)
|
||||
return _check_plugins_configured
|
||||
|
Loading…
Reference in New Issue
Block a user