~ubuntu-branches/ubuntu/utopic/horizon/utopic-proposed

« back to all changes in this revision

Viewing changes to openstack_dashboard/api/cinder.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Corey Bryant
  • Date: 2014-12-08 13:22:56 UTC
  • mfrom: (0.7.1) (1.1.47)
  • Revision ID: package-import@ubuntu.com-20141208132256-2qc1nrl1f0yknr2v
Tags: 1:2014.2.1-0ubuntu1
[ Corey Bryant ]
* Resynchronize with stable/juno (9e777f2) (LP: #1398952):
  - [ae7f053] Translation import for 2014.2.1 Juno stable update
  - [13b0c0e] Prevent leaking `target` info into subsequent `policy.check()` calls
  - [9144738] Fix dashboard nav, when panelgroup empty
  - [a2edb3d] Fix Instance Details error when using Cinder V2
  - [d44c663] Make labels in Network Topology translatable
  - [ed895a1] Make update metadata segments translatable
  - [d546faf] Make status in instance details screen translatable
  - [146a722] Handle negative values in total*Used for Cinder absolute limits
  - [7dbdd1c] Fix borders for "Actions" column in Firefox
  - [9e777f2] Update WSGI app creation to be compatible with Django 1.7
* d/p/fix-dashboard-django-wsgi.patch: Rebased.
* d/bundle-xstatic.sh: Extract tar file after generating it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
484
484
    limits = cinderclient(request).limits.get().absolute
485
485
    limits_dict = {}
486
486
    for limit in limits:
487
 
        # -1 is used to represent unlimited quotas
488
 
        if limit.value == -1:
489
 
            limits_dict[limit.name] = float("inf")
 
487
        if limit.value < 0:
 
488
            # In some cases, the absolute limits data in Cinder can get
 
489
            # out of sync causing the total.*Used limits to return
 
490
            # negative values instead of 0. For such cases, replace
 
491
            # negative values with 0.
 
492
            if limit.name.startswith('total') and limit.name.endswith('Used'):
 
493
                limits_dict[limit.name] = 0
 
494
            else:
 
495
                # -1 is used to represent unlimited quotas
 
496
                limits_dict[limit.name] = float("inf")
490
497
        else:
491
498
            limits_dict[limit.name] = limit.value
492
499
    return limits_dict