maas-cli stdout is not json formated

Bug #1282218 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
maas (Ubuntu)
Triaged
High
Unassigned

Bug Description

previously, 'maas-cli MAASNAME nodes list' would produce json formated output
to stdout. Now, it produces invalid json. This is because its writing a
deprecation warning to stdout that should go to stderr.

$ maas-cli list 2>/dev/null
  WARNING: The maas-cli command is deprecated and will be removed in a future
  version. From now on please use 'maas' instead.
admin http://localhost/MAAS/api/1.0/ NyLhcdfTbR926dqG5g:mVrUNqFvjnV9xg8F7a:K8FCtSLgkVDERxDjU2J6z8QvNzMjBSTS
smoser http://localhost/MAAS/api/1.0/ uwWpQxVC2qq59tvGJU:HXCNAJxu6SH7KUuvwt:kWn2rTf5c6AsZDQSzP54R5cF4CMYGcuP

That is fixed with:
maas-cli admin nodes list | sed '1d; 2d' | python -c 'import json, sys; json.load(sys.stdin)'

essentially your deprecation warning caused a regression.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: maas-cli 1.5+bzr1951-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-8.28-generic 3.13.2
Uname: Linux 3.13.0-8-generic x86_64
ApportVersion: 2.13.2-0ubuntu5
Architecture: amd64
Date: Wed Feb 19 18:46:16 2014
PackageArchitecture: all
SourcePackage: maas
UpgradeStatus: Upgraded to trusty on 2013-05-22 (273 days ago)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Robie Basak (racb) wrote :

Looks like this is coming from packaging, in debian/extras/maas.

Changed in maas (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Robie Basak (racb) wrote :

High because part of the point of a CLI is scripting, and presumably this breaks it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.