maas login --cacerts can't handle non-ascii
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
Medium
|
Anton Troyanov | ||
3.5 |
Fix Released
|
Medium
|
Anton Troyanov |
Bug Description
I'm logging into the maas API using the CLI with our private certs. We've added the cert chain to our system certificate authority stuff. (I'm not sure on my terminology here.)
This fails:
$ maas login --cacerts /etc/pki/
[...snip usage message...]
'ascii' codec can't encode character '\u0151' in position 137865: ordinal not in range(128)
If I remove the offending characters from the comments of the system cert file:
$ diff /etc/pki/
2401c2401
< # NetLock Arany (Class Gold) Főtanúsítvány
---
> # NetLock Arany (Class Gold)
...it works:
$ maas login --cacerts /etc/pki/
You are now logged in to the MAAS server at
[...etc...]
Is there a way to get maas to ignore non-ascii characters in the comments on a cacerts file?
System details:
Rocky Linux release 9.4
snapd-2.
maas 3.4.2-14353-
Related branches
- Anton Troyanov: Approve
-
Diff: 14 lines (+3/-1)1 file modifiedsrc/maascli/cli.py (+3/-1)
- MAAS Lander: Approve
- Alessandro Marcolini: Approve
-
Diff: 14 lines (+3/-1)1 file modifiedsrc/maascli/cli.py (+3/-1)
Changed in maas: | |
status: | In Progress → Fix Committed |
Hi Andrew,
Can you please try to apply the following change in src/maascli/cli.py?
- type=argparse.
+ type=argparse.
)
The easiest way to test it would be:
> cd /tmp current/ lib/python3. 10/site- packages/ maascli/ cli.py . current/ lib/python3. 10/site- packages/ maascli/ cli.py
> cp /snap/maas/
> sudo mount -o bind,ro /tmp/cli.py /snap/maas/
> sudo snap restart maas