Revision d14155e3 snf-cyclades-app/synnefo/quotas/util.py
b/snf-cyclades-app/synnefo/quotas/util.py | ||
---|---|---|
103 | 103 |
return qh.service_get_quotas(user) |
104 | 104 |
|
105 | 105 |
|
106 |
def get_qh_users_holdings(users=None): |
|
107 |
qh = Quotaholder.get() |
|
108 |
if users is None or len(users) != 1: |
|
109 |
req = None |
|
110 |
else: |
|
111 |
req = users[0] |
|
112 |
quotas = qh.service_get_quotas(req) |
|
113 |
|
|
114 |
if users is None: |
|
115 |
return quotas |
|
116 |
|
|
117 |
qs = {} |
|
118 |
for user in users: |
|
119 |
try: |
|
120 |
qs[user] = quotas[user] |
|
121 |
except KeyError: |
|
122 |
pass |
|
123 |
return qs |
|
124 |
|
|
125 |
|
|
106 | 126 |
def transform_quotas(quotas): |
107 | 127 |
d = {} |
108 | 128 |
for resource, counters in quotas.iteritems(): |
Also available in: Unified diff