Floating IP addresses ordered in a weird way

Bug #1308984 reported by Ian Kumlien
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Expired
Low
Unassigned

Bug Description

The floating ip:s are ordered according to UUID instead of IP, more information in the patch.

---
commit 83a10bf02a5079513741039860208e277e1d12e4
Author: Ian Kumlien <email address hidden>
Date: Thu Apr 17 13:49:32 2014 +0200

    Sorting floating IP:s according to IP.

    While using alot of manually allocated floating ip:s we wondered why
    the IP list wasn't sorted. While looking at it we found that the UI
    actually does sort the IP but according to the UUID instead of the
    actual IP address.

    This change fixes this so that it's sorted according to IP.

    Found-By: Marko Bocevski <email address hidden>

diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
index c4ebbd1..d884dee 100644
--- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
+++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
@@ -69,7 +69,7 @@ class AssociateIPAction(workflows.Action):
             exceptions.handle(self.request,
                               _('Unable to retrieve floating IP addresses.'),
                               redirect=redirect)
- options = sorted([(ip.id, ip.ip) for ip in ips if not ip.port_id])
+ options = sorted([(ip.ip, ip.ip) for ip in ips if not ip.port_id])
         if options:
             options.insert(0, ("", _("Select an IP address")))
         else:

Revision history for this message
Ian Kumlien (pomac) wrote :
Revision history for this message
Ian Kumlien (pomac) wrote :

Ok, so this patch is a dud, since you still need the UUID which we effectively just removed.

Personally i think that this should be ip.ip, ip.id and then change whats actually displayed in the listview that i can't find atm.

Revision history for this message
Ian Kumlien (pomac) wrote :

So, after some wake up coffee, we now have a new patch, ;)

We use lambda to make sure that we sort on the ip section of the structure...

---
commit c1684bddfcee8cf540519a80c4f74a52489ddf77
Author: Ian Kumlien <email address hidden>
Date: Thu Apr 17 13:49:32 2014 +0200

    Sorting floating IP:s according to IP.

    While using alot of manually allocated floating ip:s we wondered why
    the IP list wasn't sorted. While looking at it we found that the UI
    actually does sort the IP but according to the UUID instead of the
    actual IP address.

    This change fixes this so that it's sorted according to IP.

    Found-By: Marko Bocevski <email address hidden>

diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
index c4ebbd1..6f7d235 100644
--- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
+++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
@@ -69,7 +69,7 @@ class AssociateIPAction(workflows.Action):
             exceptions.handle(self.request,
                               _('Unable to retrieve floating IP addresses.'),
                               redirect=redirect)
- options = sorted([(ip.id, ip.ip) for ip in ips if not ip.port_id])
+ options = sorted([(ip.id, ip.ip) for ip in ips if not ip.port_id], key=lambda ip: ip[1])
         if options:
             options.insert(0, ("", _("Select an IP address")))
         else:

Revision history for this message
Cindy Lu (clu-m) wrote :

Hi Ian,

Thanks for the patch~~

Please submit it for code review.

How to set your dev env up: https://wiki.openstack.org/wiki/Gerrit_Workflow

Revision history for this message
Ian Kumlien (pomac) wrote : Re: [Bug 1308984] Re: Floating IP addresses ordered in a weird way

Since i don't know what affiliation etc i have to have to actually join
openstack...

I can't do this on a company level...

My contribution will have to be pushed by someone else, I grant whom ever
the right according to the Contributor agreement.

On Mon, Apr 21, 2014 at 10:56 PM, Cindy Lu <email address hidden> wrote:

> Hi Ian,
>
> Thanks for the patch~~
>
> Please submit it for code review.
>
> How to set your dev env up:
> https://wiki.openstack.org/wiki/Gerrit_Workflow
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1308984
>
> Title:
> Floating IP addresses ordered in a weird way
>
> Status in OpenStack Dashboard (Horizon):
> New
>
> Bug description:
> The floating ip:s are ordered according to UUID instead of IP, more
> information in the patch.
>
> ---
> commit 83a10bf02a5079513741039860208e277e1d12e4
> Author: Ian Kumlien <email address hidden>
> Date: Thu Apr 17 13:49:32 2014 +0200
>
> Sorting floating IP:s according to IP.
>
> While using alot of manually allocated floating ip:s we wondered why
> the IP list wasn't sorted. While looking at it we found that the UI
> actually does sort the IP but according to the UUID instead of the
> actual IP address.
>
> This change fixes this so that it's sorted according to IP.
>
> Found-By: Marko Bocevski <email address hidden>
>
> diff --git
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> index c4ebbd1..d884dee 100644
> ---
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> +++
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> @@ -69,7 +69,7 @@ class AssociateIPAction(workflows.Action):
> exceptions.handle(self.request,
> _('Unable to retrieve floating IP
> addresses.'),
> redirect=redirect)
> - options = sorted([(ip.id, ip.ip) for ip in ips if not
> ip.port_id])
> + options = sorted([(ip.ip, ip.ip) for ip in ips if not
> ip.port_id])
> if options:
> options.insert(0, ("", _("Select an IP address")))
> else:
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/horizon/+bug/1308984/+subscriptions
>

Revision history for this message
Julie Pichon (jpichon) wrote :

There's an individual CLA that you could sign as an individual, which may then allow you to make your contribution as an "Independent", would that work?

https://wiki.openstack.org/wiki/HowToContribute#Contributors_License_Agreement

Revision history for this message
Ian Kumlien (pomac) wrote :

Right now i can't do anything about that - as is now, either take the patch
as is or wait for a long time =P

On Tue, Apr 22, 2014 at 12:17 PM, Julie Pichon
<email address hidden>wrote:

> There's an individual CLA that you could sign as an individual, which
> may then allow you to make your contribution as an "Independent", would
> that work?
>
>
> https://wiki.openstack.org/wiki/HowToContribute#Contributors_License_Agreement
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1308984
>
> Title:
> Floating IP addresses ordered in a weird way
>
> Status in OpenStack Dashboard (Horizon):
> New
>
> Bug description:
> The floating ip:s are ordered according to UUID instead of IP, more
> information in the patch.
>
> ---
> commit 83a10bf02a5079513741039860208e277e1d12e4
> Author: Ian Kumlien <email address hidden>
> Date: Thu Apr 17 13:49:32 2014 +0200
>
> Sorting floating IP:s according to IP.
>
> While using alot of manually allocated floating ip:s we wondered why
> the IP list wasn't sorted. While looking at it we found that the UI
> actually does sort the IP but according to the UUID instead of the
> actual IP address.
>
> This change fixes this so that it's sorted according to IP.
>
> Found-By: Marko Bocevski <email address hidden>
>
> diff --git
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> index c4ebbd1..d884dee 100644
> ---
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> +++
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> @@ -69,7 +69,7 @@ class AssociateIPAction(workflows.Action):
> exceptions.handle(self.request,
> _('Unable to retrieve floating IP
> addresses.'),
> redirect=redirect)
> - options = sorted([(ip.id, ip.ip) for ip in ips if not
> ip.port_id])
> + options = sorted([(ip.ip, ip.ip) for ip in ips if not
> ip.port_id])
> if options:
> options.insert(0, ("", _("Select an IP address")))
> else:
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/horizon/+bug/1308984/+subscriptions
>

Revision history for this message
Julie Pichon (jpichon) wrote :

That's too bad. There's all sorts of confusing issues around proposing patches that were attached on Launchpad by someone who didn't sign the CLA (see e.g. http://lists.openstack.org/pipermail/openstack-dev/2013-December/022862.html for a recent iteration of that discussion). Hopefully the patch is small enough here that it won't become an issue.

Revision history for this message
Ian Kumlien (pomac) wrote :

the problem is that i can't sign the independent CLA since i'm not a member
of openstack. To be a member of openstack I have to select a affiliation.
With the affiliation being unknown, i can't sign the CLA.

All i can say is that I have tried to sign it multiple times =P

On Tue, Apr 22, 2014 at 3:03 PM, Julie Pichon <email address hidden>wrote:

> That's too bad. There's all sorts of confusing issues around proposing
> patches that were attached on Launchpad by someone who didn't sign the
> CLA (see e.g. http://lists.openstack.org/pipermail/openstack-
> dev/2013-December/022862.html for a recent iteration of that
> discussion). Hopefully the patch is small enough here that it won't
> become an issue.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1308984
>
> Title:
> Floating IP addresses ordered in a weird way
>
> Status in OpenStack Dashboard (Horizon):
> New
>
> Bug description:
> The floating ip:s are ordered according to UUID instead of IP, more
> information in the patch.
>
> ---
> commit 83a10bf02a5079513741039860208e277e1d12e4
> Author: Ian Kumlien <email address hidden>
> Date: Thu Apr 17 13:49:32 2014 +0200
>
> Sorting floating IP:s according to IP.
>
> While using alot of manually allocated floating ip:s we wondered why
> the IP list wasn't sorted. While looking at it we found that the UI
> actually does sort the IP but according to the UUID instead of the
> actual IP address.
>
> This change fixes this so that it's sorted according to IP.
>
> Found-By: Marko Bocevski <email address hidden>
>
> diff --git
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> index c4ebbd1..d884dee 100644
> ---
> a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> +++
> b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py
> @@ -69,7 +69,7 @@ class AssociateIPAction(workflows.Action):
> exceptions.handle(self.request,
> _('Unable to retrieve floating IP
> addresses.'),
> redirect=redirect)
> - options = sorted([(ip.id, ip.ip) for ip in ips if not
> ip.port_id])
> + options = sorted([(ip.ip, ip.ip) for ip in ips if not
> ip.port_id])
> if options:
> options.insert(0, ("", _("Select an IP address")))
> else:
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/horizon/+bug/1308984/+subscriptions
>

Revision history for this message
Julie Pichon (jpichon) wrote :

Oh, so it's not an issue with signing the CLA itself? You should be able to put in "None" as an affiliation, if that is the truth (that is, if you worked independently on this patch and the IP/copyright belongs to you). Feel free to pop by #openstack-community if you'd like help or to discuss this further! There are folks who are more familiar with this kind of issues.

Revision history for this message
Julie Pichon (jpichon) wrote :

Link to a new thread around the CLA that was sparked by this patch/discussion: http://lists.openstack.org/pipermail/legal-discuss/2014-April/000217.html

no longer affects: openstack-community
Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

Should be simple matter of applying the attached patch.

Changed in horizon:
status: New → Confirmed
importance: Undecided → Low
tags: added: low-hanging-fruit
Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

I have created several floating IPs and found that even without this patch being applied, that the IP addresses are ordered in the logical sorted order in the "associate" workflow. Ian Kumlien, can you reproduce this and list the precise steps to do so?

Changed in horizon:
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Dashboard (Horizon) because there has been no activity for 60 days.]

Changed in horizon:
status: Incomplete → Expired
Revision history for this message
Ian Kumlien (pomac) wrote :

Gary: If your UUID:s just happen to align properly then this is not a problem, but it's not actually sorting IP:s as IP:s which imho is wrong and it does do it wrong on some instances.

Ie, if sort by IP then actually sort by IP and not UUID. (we have been suffering from this on several occasions.)

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.