Interface model validates the MAC address twice

Bug #1696108 reported by Данило Шеган
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Alberto Donato

Bug Description

Interface model in src/maasserver/models/interface.py validates MAC address twice when used in a form. Once as part of the clean() method:

        # Verify that the MAC address is legal if it is not empty.
        if self.mac_address:
            validate_mac(self.mac_address)

Another time as a default_validator on MACAddressField, which results in the ValidationError being raised twice for the same field, eg. in a test like the following:

bin/test.region -v maasserver.models.tests.test_interface:InterfaceTest.test_rejects_invalid_mac_address

Simply dropping validate_mac() from the Interface.clean() resulted in further test failures which I didn't spend time investigating because I was focused on driving the Django upgrade forward.

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.3.0
Changed in maas:
milestone: 2.3.0 → 2.3.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
Alberto Donato (ack)
Changed in maas:
milestone: 2.3.x → 3.4.0
status: Invalid → In Progress
assignee: nobody → Alberto Donato (ack)
Revision history for this message
Alberto Donato (ack) wrote :

This was fixed in 20c7bab82637b683752f8233bdb996093a73b9d9 (extra validation was removed).

Changed in maas:
status: In Progress → Fix Committed
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.0-beta1
Alberto Donato (ack)
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.