Merge ~sbparke/charm-juju-lint:bug/1950983 into charm-juju-lint:master

Proposed by Steven Parker
Status: Rejected
Rejected by: Haw Loeung
Proposed branch: ~sbparke/charm-juju-lint:bug/1950983
Merge into: charm-juju-lint:master
Diff against target: 26 lines (+4/-4)
1 file modified
scripts/templates/auto_lint.py (+4/-4)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack (community) continuous-integration Needs Fixing
BootStack Reviewers mr tracking; do not claim Pending
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+411888@code.launchpad.net

Commit message

Now passing ca-cert as ascii format as it is really binary and trying to parse as UTF-8 will be unstable/unreliable

Description of the change

ca-cert is really binary and trying to parse as UTF-8 will be unstable/unreliable
Best to simply pass on as ascii base64 encoded value.
I have modified the code and tested just passing the ascii configuration value and this works fine.

b64decode(auto_lint_config["controller-cacert"]).decode() -> cacert = auto_lint_config["controller-cacert"]

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Steven Parker (sbparke) wrote :
~sbparke/charm-juju-lint:bug/1950983 updated
a286bb5... by Steven Parker

Fixed style errors

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)

Unmerged commits

a286bb5... by Steven Parker

Fixed style errors

7a8df02... by Steven Parker

Now passing ca-cert as ascii format as it is really binary and trying to parse as UTF-8 will be unstable/unreliable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/templates/auto_lint.py b/scripts/templates/auto_lint.py
2index 4b8da76..d84f05e 100755
3--- a/scripts/templates/auto_lint.py
4+++ b/scripts/templates/auto_lint.py
5@@ -20,7 +20,6 @@ License: Apache License 2.0
6 """
7
8 import argparse
9-from base64 import b64decode
10 import json
11 import logging
12 from os.path import join
13@@ -74,9 +73,10 @@ def verify_auto_lint_config(auto_lint_config):
14 async def get_juju_status(auto_lint_config):
15 """Get juju status."""
16 model = Model(max_frame_size=MAX_FRAME_SIZE)
17- # As b64decode returns bytes instead of str, we need to convert it
18- # using .decode() on the bytes object.
19- cacert = b64decode(auto_lint_config["controller-cacert"]).decode()
20+
21+ # sbparke modified this logic to just send raw ascii formatted cert
22+ # due to transcoding failure as data is not always valid utf8
23+ cacert = auto_lint_config["controller-cacert"]
24 await model.connect(
25 endpoint=auto_lint_config["controller-endpoint"],
26 username=auto_lint_config["controller-username"],

Subscribers

People subscribed via source and target branches

to all changes: