kmip: fix destroy key #1875
The inner except Exception: pass will silently swallow programming errors (e.g., a TypeError from an incorrect revoke argument name) as well as unexpected server/transport failures, making destroy failures harder to diagnose. Please catch the specific KMIP/pykmip exception(s) that indicate "already revoked"/"invalid state", and for anything else either log the revoke failure (at least in JSON output) or re-raise so the user gets a clear error.
Pull request overview
Fixes KMIP passphrase destruction in the test KMIP CLI by attempting to revoke an object before destroying it (objects may need to be revoked when active).
Changes:
destroy_passphrase to handle active objects.---
💡 <a href="/ceph/ceph-nvmeof/new/devel?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
done
Approved these changes.
The handling of the "already revoked" case is currently based on matching substrings in str(e) ("ILLEGAL_OPERATION" and "not active"). This is brittle (message wording/casing can differ across KMIP server implementations and pykmip versions) and could cause destroy to fail intermittently. Prefer checking structured fields on the exception/response (e.g., result reason/status) or at least normalize casing and match on a single stable indicator rather than free-form message text.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
---
💡 <a href="/ceph/ceph-nvmeof/new/devel?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
it is ok because the cli works just with the dummy kmip server
Hezko
gadididi
There was little bug, the key could not be destroyed because it was active. need to revoke first.