Revision 437c0052 snf-astakos-app/astakos/im/endpoints/qh.py
b/snf-astakos-app/astakos/im/endpoints/qh.py | ||
---|---|---|
46 | 46 |
from kamaki.clients.quotaholder import QuotaholderClient |
47 | 47 |
from kamaki.clients.quotaholder import QH_PRACTICALLY_INFINITE |
48 | 48 |
|
49 |
from synnefo.util.number import strbigdec |
|
50 |
|
|
49 | 51 |
ENTITY_KEY = '1' |
50 | 52 |
|
51 | 53 |
|
... | ... | |
154 | 156 |
QuotaLimits = namedtuple('QuotaLimits', ('holder', |
155 | 157 |
'resource', |
156 | 158 |
'capacity', |
157 |
'import_limit',
|
|
159 |
'import_limit', |
|
158 | 160 |
'export_limit')) |
159 | 161 |
|
160 |
QuotaValues = namedtuple('QuotaValues', ('quantity', |
|
161 |
'capacity', |
|
162 |
'import_limit', |
|
163 |
'export_limit')) |
|
162 |
class QuotaValues(namedtuple('QuotaValues', ('quantity', |
|
163 |
'capacity', |
|
164 |
'import_limit', |
|
165 |
'export_limit'))): |
|
166 |
__slots__ = () |
|
167 |
def __dir__(self): |
|
168 |
return ['quantity', 'capacity', 'import_limit', 'export_limit'] |
|
169 |
|
|
170 |
def __str__(self): |
|
171 |
return '\t'.join(['%s=%s' % (f, strbigdec(getattr(self, f))) for f in dir(self)]) |
|
164 | 172 |
|
165 | 173 |
def add_quota_values(q1, q2): |
166 | 174 |
return QuotaValues( |
Also available in: Unified diff