CLI errors when redirecting the output to a file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Alexsander de Souza |
Bug Description
Using MAAS 3.3.0-beta2, when redirecting the CLI output to a file, we get this error:
$ maas admin machines read > test.list
usage: maas [-h] COMMAND ...
options:
-h, --help show this help message and exit
drill down:
COMMAND
login Log in to a remote API, and remember its description and
logout Log out of a remote API, purging any stored credentials.
list List remote APIs that have been logged-in to.
refresh Refresh the API descriptions of all profiles.
init Initialize controller.
apikey Used to manage a user's API keys. Shows existing keys unless
configauth Configure external authentication.
config-tls Configure MAAS Region TLS.
config-vault (placeholder) Configure MAAS Region Vault integration.
createadmin Create a MAAS administrator account.
changepassword
admin Interact with http://
cannot use a string pattern on a bytes-like object
The location of the file doesn't change the results, even writing to /dev/null errors. Using a pipe (|) instead of redirection also errors. Calling the command without redirections work as expected.
Related branches
- Alberto Donato (community): Approve
- MAAS Lander: Approve
-
Diff: 96 lines (+18/-22)3 files modifiedsrc/maascli/__init__.py (+0/-13)
src/maascli/tests/test_integration.py (+1/-4)
src/maascli/utils.py (+17/-5)
- Anton Troyanov: Approve
- MAAS Lander: Approve
-
Diff: 52 lines (+17/-1)2 files modifiedsrc/maascli/__init__.py (+13/-0)
src/maascli/tests/test_integration.py (+4/-1)
Changed in maas: | |
status: | New → Triaged |
Changed in maas: | |
assignee: | nobody → Alexsander de Souza (alexsander-souza) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 3.3.0 → 3.3.0-beta3 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas: | |
status: | Fix Released → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
It seems to work for the snap version (3.3.0~ beta1-12847- g.2e1950694)