Composing a machine should error if name contains underscore

Bug #1823265 reported by Chris Johnston
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Newell Jensen

Bug Description

When composing a machine, if I under a name that contains an underscore I am allowed to click 'Compose machine', however, the name is changed to a name provided by MAAS. This is an unexpected behaviour and would be better if an error were provided showing that you can't compose a machine with an underscore.

2.5.2 (7523-ge4ecbd54d-0ubuntu1~18.04.1)

Tags: ui

Related branches

Lee Trager (ltrager)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.6.0alpha2
Changed in maas:
milestone: 2.6.0alpha2 → 2.6.0beta1
tags: added: ui
Changed in maas:
milestone: 2.6.0beta1 → 2.6.0beta2
Revision history for this message
Andres Rodriguez (andreserl) wrote :

The solution should that the backend needs to validate that hostnames never use underscores.

Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maas:
milestone: 2.6.0beta2 → 2.6.0rc1
Revision history for this message
Lilyana Videnova (lilyanavidenova) wrote :

I think we should disable the "Compose" button, similarly to how the "Save" button is disabled upon entering an underscore, as otherwise the user can submit the invalid value and would then see an error.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

That’s a possibility, that said, this issue is really a backend issue!

Revision history for this message
Chris Johnston (cjohnston) wrote :

When using the CLI to compose a machine and specifying a hostname with an underscore the machine is assigned a random name. I would expect this to also return a message preventing the behaviour. Certainly seems like a backend issue.

Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
status: Fix Committed → New
Changed in maas:
status: New → In Progress
Revision history for this message
Newell Jensen (newell-jensen) wrote :

https://code.launchpad.net/~newell-jensen/maas/+git/maas/+merge/367142

This branch uses ValidationSErvice.validateHostname for the validation and also adds unit tests as those were not originally added.

Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 2.6.0rc1 → 2.6.0beta4
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.