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

Allows you to skip the repair of missing permission for update endpoint #371

Merged
merged 1 commit into from
Dec 8, 2024
Merged
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
12 changes: 8 additions & 4 deletions custom_components/proxmoxve/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def permission_to_resource(
return "Unmapped"

try:
return get_api(proxmox, api_path)
api_data = get_api(proxmox, api_path)
except AuthenticationError as error:
raise ConfigEntryAuthFailed from error
except (
Expand All @@ -848,9 +848,12 @@ def permission_to_resource(
severity=ir.IssueSeverity.ERROR,
translation_key="resource_exception_forbiden",
translation_placeholders={
"resource": f"{api_category.capitalize()} {resource_id}",
"resource": f"{api_category.capitalize()} {resource_id.replace(f"{ProxmoxType.Update.capitalize()} ", "")}",
"user": config_entry.data[CONF_USERNAME],
"permission": permission_to_resource(api_category, resource_id),
"permission": permission_to_resource(
api_category,
resource_id.replace(f"{ProxmoxType.Update.capitalize()} ", ""),
),
},
)
LOGGER.debug(
Expand All @@ -862,4 +865,5 @@ def permission_to_resource(
hass,
DOMAIN,
f"{config_entry.entry_id}_{resource_id}_forbiden",
)
)
return api_data
Loading