Misleading MACAlreadyExists exception

Bug #1308199 reported by Josh Gachnang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Expired
Undecided
Unassigned

Bug Description

This code raises a MACAlreadyExists exception, when it should be something like UUIDAlreadyExists exception. I think this is due to get_by_uuid accepting a UUID or a MAC. If you add a UUID kwarg that is different than the get_test_port's UUID, the error goes away.

def _create_test_port(self, **kwargs):
        p = db_utils.get_test_port(**kwargs)
        return self.dbapi.create_port(p)

fake_port1 = self._create_test_port(node_id=123,
                                    address="aa:bb:cc:dd:ee:fe")
fake_port2 = self._create_test_port(node_id=123,
                                    id=42,
                                    address="aa:bb:cc:dd:ee:fb")

Josh Gachnang (joshnang)
Changed in ironic:
assignee: nobody → Josh Gachnang (joshnang)
Revision history for this message
Dmitry Tantsur (divius) wrote :

Hi Josh! Could you give status update on this bug? If you're still working on it, please set status to In Progress and link your patch here, if any.

Revision history for this message
Dmitry Tantsur (divius) wrote :

Hi! Per global bugs clean-up, we're unassigning bugs that are without patch and other visible progress for more than 7 days. Please feel free to reassign yourself, set status to In Progress and leave some status comment, if this is wrong. Thank you for understanding!

Also, the only place where create_test_port is present is in test_pxe and uuid argument is used there. Could you clarify, whether this bug is present now?

Changed in ironic:
assignee: Josh Gachnang (joshnang) → nobody
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Ironic because there has been no activity for 60 days.]

Changed in ironic:
status: Incomplete → Expired
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.