Merge "Avoid using len(x) to check if x is empty"

This commit is contained in:
Jenkins 2016-03-01 18:48:21 +00:00 committed by Gerrit Code Review
commit e4c39f69a2
3 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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