fix install scope

pull/19963/head
zhangx1n 11 months ago
parent e638a758f7
commit fb96e0b103

@ -351,6 +351,10 @@ class PluginService:
@staticmethod
def install_from_local_pkg(tenant_id: str, plugin_unique_identifiers: Sequence[str]):
manager = PluginInstaller()
for plugin_unique_identifier in plugin_unique_identifiers:
resp = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier)
PluginService._check_plugin_installation_availability(resp.verification)
return manager.install_from_identifiers(
tenant_id,
plugin_unique_identifiers,
@ -365,6 +369,8 @@ class PluginService:
returns plugin_unique_identifier
"""
manager = PluginInstaller()
plugin_decode_response = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier)
PluginService._check_plugin_installation_availability(plugin_decode_response.verification)
return manager.install_from_identifiers(
tenant_id,
[plugin_unique_identifier],
@ -421,6 +427,9 @@ class PluginService:
for plugin_unique_identifier in plugin_unique_identifiers:
try:
manager.fetch_plugin_manifest(tenant_id, plugin_unique_identifier)
plugin_decode_response = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier)
# check if the plugin is available to install
PluginService._check_plugin_installation_availability(plugin_decode_response.verification)
# already downloaded, skip
except Exception:
# plugin not installed, download and upload pkg

Loading…
Cancel
Save