maas cli writes deprecation warning to stdout

Bug #1431360 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Raphaël Badin

Bug Description

installed maas from experimental ppa on trusty, tried to create an admin, get its api keys and start using the cli.
However, the 'maas-region-admin apikey' command writes a deprecation warning to stdout rather than stderr.
That means that doing this no longer works:
 $ apikey=$( maas-region-admin apikey --username=smoser )
 $ maas login "smoser" "http://127.0.0.1/MAAS/api/1.0" $apikey

Details below.

$ dpkg-query --show "*maas*"
maas 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-cli 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-cluster-controller 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-common 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-dhcp 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-dns 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-proxy 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-region-controller 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
maas-region-controller-min 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
python-django-maas 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
python-maas-client 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1
python-maas-provisioningserver 1.8.0~alpha6+bzr3625-0ubuntu1~trusty1

$ maas-region-admin createadmin "--username=smoser" --<email address hidden> --password=password
$ echo $?
0
$ maas-region-admin apikey --username=smoser > cmd.out 2> cmd.err
$ echo $?
0

$ ls -l cmd.out cmd.err
-rw-r--r-- 1 root root 0 Mar 12 13:38 cmd.err
-rw-r--r-- 1 root root 347 Mar 12 13:38 cmd.out

$ cat cmd.out
2015-03-12 13:38:18 [py.warnings] WARNING: /usr/lib/python2.7/dist-packages/maasserver/management/commands/apikey.py:101: DeprecationWarning: The use of AUTH_PROFILE_MODULE to define user profiles has been deprecated.
  tokens = user.get_profile().get_authorisation_tokens()

FThK5ucRdjfM4F4GUG:eb3ztqaXrazMVRHPaT:FyaVQGBYgyY9TzpPfVj2zXw8yQwnxLVf

Tags: django-1.7

Related branches

Revision history for this message
Raphaël Badin (rvb) wrote :

The warning is coming from Django, we have to silence it/print it to stderr. See http://django.readthedocs.org/en/latest/releases/1.5.html#auth-profile-module for details.

Changed in maas:
status: New → Triaged
tags: added: django-1.7
Raphaël Badin (rvb)
Changed in maas:
importance: Undecided → High
Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → Fix Committed
milestone: none → 1.8.0
Changed in maas:
status: Fix Committed → Fix Released
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.