Fix: don't hardcode client class name. (#555)
Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
# Modifications Copyright OpenSearch Contributors. See
|
||||
# GitHub history for details.
|
||||
|
||||
|
||||
import warnings
|
||||
|
||||
from ..plugins.alerting import AlertingClient
|
||||
@@ -45,9 +44,7 @@ class PluginsClient(NamespacedClient):
|
||||
setattr(client, plugin, getattr(self, plugin))
|
||||
else:
|
||||
warnings.warn(
|
||||
"Cannot load `{plugin}` directly to OpenSearch. `{plugin}` already exists in OpenSearch. Please use `OpenSearch.plugin.{plugin}` instead.".format(
|
||||
plugin=plugin
|
||||
),
|
||||
f"Cannot load `{plugin}` directly to {self.client.__class__.__name__} as it already exists. Use `{self.client.__class__.__name__}.plugin.{plugin}` instead.",
|
||||
category=RuntimeWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user