Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing parameter token #33

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/spaceone/plugin/manager/repository_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs):
SpaceConnector, service="repository"
)

def get_plugin(self, plugin_id: str, domain_id, token: str) -> dict:
def get_plugin(self, plugin_id: str, domain_id: str, token: str) -> dict:
return self.repo_connector.dispatch(
"Plugin.get", {"plugin_id": plugin_id}, token=token, x_domain_id=domain_id
)
Expand Down
6 changes: 3 additions & 3 deletions src/spaceone/plugin/service/plugin_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _get_plugin_endpoint(self, params: dict, token: str):

# There is no installed plugin
# Check plugin_id, version is valid or not
self._check_plugin(plugin_id, version, token)
self._check_plugin(plugin_id, domain_id, version, token)

# Create or Fail
matched_supervisors = self.supervisor_mgr.get_matched_supervisors(
Expand Down Expand Up @@ -265,12 +265,12 @@ def _select_one(choice_list, algorithm="random"):
return random.choice(choice_list)
_LOGGER.error(f"[_select_one] unimplemented algorithm: {algorithm}")

def _check_plugin(self, plugin_id: str, version: str, token: str):
def _check_plugin(self, plugin_id: str, domain_id: str, version: str, token: str):
"""Check plugin_id:version exist or not"""
repo_mgr = self.locator.get_manager("RepositoryManager")
# Check plugin_id
try:
repo_mgr.get_plugin(plugin_id, token)
repo_mgr.get_plugin(plugin_id, domain_id, token)
except Exception as e:
_LOGGER.error(f"[_check_plugin] {plugin_id} does not exist")
raise ERROR_PLUGIN_NOT_FOUND(plugin_id=plugin_id)
Expand Down