Change MAC representation in nailgun

Bug #1395674 reported by Sebastian Kalinowski
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Triaged
Medium
Fuel Sustaining
Mitaka
Won't Fix
Medium
Fuel Python (Deprecated)
Newton
Triaged
Medium
Fuel Sustaining

Bug Description

In Nailgun MAC address is a string (both in code and in DB).
Due to this 'AA:BB:CC:11:22:33' != 'aa:bb:cc:11:22:33' in many places.
This cause bugs like https://bugs.launchpad.net/fuel/+bug/1394466 which was a basically a problem with comparing lowercase MAC and uppecase MAC.

We need to:
* move MAC address in our DB to buil-in postgress type "macaddr" (http://www.postgresql.org/docs/9.3/static/datatype-net-types.html#DATATYPE-MACADDR)
* use netaddr module (https://pypi.python.org/pypi/netaddr) to compare and validate MACs.

After this it will be possible to user not only lower and uppercase MACs but also MACs in different formats.

Changed in fuel:
importance: Undecided → High
Changed in fuel:
status: New → Confirmed
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Roman Prykhodchenko (romcheg)
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

We can't use MAC address from built-in postgres type due to the issue:

    https://bugs.launchpad.net/fuel/+bug/1398882

Revision history for this message
Roman Prykhodchenko (romcheg) wrote :

Right, it's not possible to use Postgresql's embedded type for that because HW addresses for IPoIB of IPoFC or for IPoSMTH are going to have different representation.

Therefore I can see two possible solutions and both of them keep storing HW address as a string but decorated by SQLAlchemy's type decorator. The difference between them is the following:

 - The first solution assumes creation of a HWAddress type that uses netaddr.EUI underneath for manipulating standard 48 and 64 bits IEEE EUIs and custom implementations for exotic HW addresses, e.g., for IPoIB.

 - The second assumes that the type decorator represents HW addresses as netaddr.EUIs. After that it is necessary to merge support for exotic EUIs right to netaddr.

I'd say that the second approach is better. I already emailed David, the maintainer of netaddr, to ask whether he's open for this kind of changes.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/142244

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Roman Prykhodchenko (romcheg) wrote :

ATM I have no free time to work on this. The bug requires some extra patches to be landed to upstream of netaddr and a minor update in the patch, mentioned above.

Changed in fuel:
status: In Progress → Triaged
assignee: Roman Prykhodchenko (romcheg) → nobody
importance: High → Medium
Changed in fuel:
assignee: nobody → Fuel Library Team (fuel-library)
Changed in fuel:
assignee: Fuel Library Team (fuel-library) → Fuel Python Team (fuel-python)
Dmitry Pyzhov (dpyzhov)
tags: added: module-networks
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Waiting for upstream update

Changed in fuel:
milestone: 6.1 → 7.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (master)

Change abandoned by Dmitry Pyzhov (<email address hidden>) on branch: master
Review: https://review.openstack.org/142244
Reason: No activity for more than a month

Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

Moved to 8.0. It is our tech-debt.

Changed in fuel:
status: Triaged → Won't Fix
tags: added: tech-debt
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 7.0 → 8.0
status: Won't Fix → Triaged
no longer affects: fuel/8.0.x
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Changed in fuel:
milestone: 8.0 → 9.0
Revision history for this message
Ivan Ponomarev (ivanzipfer) wrote :

let use linux standard MAC's (lowercase) format which can be found using cli tools like ip or ifconfig

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.