diff options
| author | Alexander Gräb <alexander.graeb@secustack.com> | 2020-07-07 11:04:33 +0200 |
|---|---|---|
| committer | Alexander Gräb <alexander.graeb@secustack.com> | 2020-07-07 13:26:51 +0200 |
| commit | c06d82563526c715d3ed508fa3cc5f9dc0963294 (patch) | |
| tree | 68c2a699acf864d3c2b09179ce253fb8573f4af8 | |
| parent | 1d8781a3690aec93570d0f0bb3bfe43905f49196 (diff) | |
| download | python-openstackclient-c06d82563526c715d3ed508fa3cc5f9dc0963294.tar.gz | |
Fix uploading an signed image does not work if private signing key is encrypted
Change-Id: Ia7c84aa7b840bf92aeb7db7246d14119eb727b03
Story: 2007890
Task: 40269
| -rw-r--r-- | openstackclient/image/v2/image.py | 6 | ||||
| -rw-r--r-- | releasenotes/notes/fix-story-2007890-0974f3e69f26801e.yaml | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 53ce560d..50a64d4c 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -429,8 +429,14 @@ class CreateImage(command.ShowOne): prompt=("Please enter private key password, leave " "empty if none: "), confirm=False) + if not pw or len(pw) < 1: pw = None + else: + # load_private_key() requires the password to be + # passed as bytes + pw = pw.encode() + signer.load_private_key( sign_key_path, password=pw) diff --git a/releasenotes/notes/fix-story-2007890-0974f3e69f26801e.yaml b/releasenotes/notes/fix-story-2007890-0974f3e69f26801e.yaml new file mode 100644 index 00000000..87d6f18b --- /dev/null +++ b/releasenotes/notes/fix-story-2007890-0974f3e69f26801e.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + While uploading a signed image, a private key to sign that image must be + specified. The CLI client asks for the password of that private key. Due + to wrong encoding handling while using Python 3, the password is not + accepted, whether it is correct or not. |
