'maas createsuperuser' errors out if no email address is entered.

Bug #1243917 reported by Patricia Gaughen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Jeroen T. Vermeulen
maas (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Was getting MAAS setup on my system, just to play with it, and didn't enter an email address. The tool didn't complain about leaving the email address blank, but when the the tool exited the superuser wasn't created and an error message was displayed.

Here is the output (and yes, I tried to leave the password blank too.. but note the command complained about leaving it blank)

gaughen@glitter:~$ sudo maas createsuperuser
Username (leave blank to use 'root'): maas_admin
Email address:
Password:
Password (again):
Error: Blank passwords aren't allowed.
Password:
Password (again):
IntegrityError: duplicate key value violates unique constraint "auth_user_email_key"
DETAIL: Key (email)=() already exists.

I think the correct behavior, if the email address is truly required, is to produce an error message similar to when you try to leave the password blank.

Related branches

Changed in maas:
milestone: none → 14.04
assignee: nobody → Jeroen T. Vermeulen (jtv)
importance: Undecided → High
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

For the historical record:

 * createsuperuser is a Django built-in command, not our code.
 * We have our own MAAS-tailored version, createadmin.
 * The email field must be unique and non-null, but can be empty.
 * MAAS already creates a system user with empty email address.
 * A null email address would be the right way to do this, but Django's supports null values more or less as an afterthought.

The simple fix is to update the documentation, so it always points users to createadmin, not createsuperuser.

Revision history for this message
Gavin Panella (allenap) wrote :

Can we create our own wrapper around django-admin (here spelled "maas") that only exposes the commands directly relevant to MAAS. We could have a maas-django-admin too, for people who want to shoot at their feet.

Changed in maas:
status: New → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in maas (Ubuntu):
status: New → Confirmed
Changed in maas (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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