Fix: don't hardcode client class name. (#555)

Signed-off-by: dblock <[email protected]>
This commit is contained in:
Daniel (dB.) Doubrovkine
2023-10-26 09:30:23 -07:00
committed by GitHub
parent 17794bab75
commit 5c7fe9dbde
4 changed files with 50 additions and 5 deletions
+1 -4
View File
@@ -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,
)