Lately I've been playing with the old nova get-password <server> [<private-key>] command, and to my surprise I found out that OSC does implement the feature (yay!). But returns the encrypted version of the key.
As a Quality-of-Life improvement, I thought of implementing an additional --private-key option to allow inline password decryption.
I gave it a try and seems to work:
https://github.com/dmbuil/openstack/tree/feature-server-password-with-privkey
Usage: osc compute server password show [OPTIONS] <SERVER_ID>
Options:
-h, --help Print help (see more with '--help')
-V, --version Print version
Path parameters:
<SERVER_ID> server_id parameter for /v2.1/servers/{server_id}/os-server-password API
Decryption:
--private-key <PATH> Path to SSH private key file used to decrypt the password. Supports OpenSSH, PEM RSA, and PKCS#8 formats. If the key is passphrase-protected you will be
prompted interactively
I tried not to go against any code-gen directive and preserve the overall spirit of the implementation, but I admit that I am quite a newbie.
Lately I've been playing with the old
nova get-password <server> [<private-key>]command, and to my surprise I found out that OSC does implement the feature (yay!). But returns the encrypted version of the key.As a Quality-of-Life improvement, I thought of implementing an additional
--private-keyoption to allow inline password decryption.I gave it a try and seems to work:
https://github.com/dmbuil/openstack/tree/feature-server-password-with-privkey
I tried not to go against any code-gen directive and preserve the overall spirit of the implementation, but I admit that I am quite a newbie.