Skip to content

Commit

Permalink
feat: insert x_domain_id when check_plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMin5 committed Dec 21, 2023
1 parent cb0583b commit 0b5347a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/spaceone/plugin/manager/repository_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ def get_plugin(self, plugin_id: str, domain_id: str, token: str) -> dict:
"Plugin.get", {"plugin_id": plugin_id}, token=token, x_domain_id=domain_id
)

def check_plugin_version(self, plugin_id, version, token: str) -> None:
def check_plugin_version(
self, plugin_id: str, version: str, token: str, domain_id: str
) -> None:
response = self.repo_connector.dispatch(
"Plugin.get_versions", {"plugin_id": plugin_id}, token=token
"Plugin.get_versions",
{"plugin_id": plugin_id},
token=token,
x_domain_id=domain_id,
)

if version not in response.get("results", []):
Expand Down
2 changes: 1 addition & 1 deletion src/spaceone/plugin/service/plugin_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def _check_plugin(self, plugin_id: str, domain_id: str, version: str, token: str

# Check version
try:
repo_mgr.check_plugin_version(plugin_id, version, token)
repo_mgr.check_plugin_version(plugin_id, version, token, domain_id)
except Exception as e:
raise ERROR_INVALID_PLUGIN_VERSION(plugin_id=plugin_id, version=version)

Expand Down

0 comments on commit 0b5347a

Please sign in to comment.