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
diff --git a/scripts/templates/auto_lint.py b/scripts/templates/auto_lint.py
index 4b8da76..d84f05e 100755
--- a/scripts/templates/auto_lint.py
+++ b/scripts/templates/auto_lint.py
@@ -20,7 +20,6 @@ License: Apache License 2.0
20"""20"""
2121
22import argparse22import argparse
23from base64 import b64decode
24import json23import json
25import logging24import logging
26from os.path import join25from os.path import join
@@ -74,9 +73,10 @@ def verify_auto_lint_config(auto_lint_config):
74async def get_juju_status(auto_lint_config):73async def get_juju_status(auto_lint_config):
75 """Get juju status."""74 """Get juju status."""
76 model = Model(max_frame_size=MAX_FRAME_SIZE)75 model = Model(max_frame_size=MAX_FRAME_SIZE)
77 # As b64decode returns bytes instead of str, we need to convert it76
78 # using .decode() on the bytes object.77 # sbparke modified this logic to just send raw ascii formatted cert
79 cacert = b64decode(auto_lint_config["controller-cacert"]).decode()78 # due to transcoding failure as data is not always valid utf8
79 cacert = auto_lint_config["controller-cacert"]
80 await model.connect(80 await model.connect(
81 endpoint=auto_lint_config["controller-endpoint"],81 endpoint=auto_lint_config["controller-endpoint"],
82 username=auto_lint_config["controller-username"],82 username=auto_lint_config["controller-username"],

Subscribers

People subscribed via source and target branches

to all changes: