Revision 12e8c717
b/snf-cyclades-app/synnefo/quotas/management/commands/enforce-resources-cyclades.py | ||
---|---|---|
58 | 58 |
make_option("--users", dest="users", |
59 | 59 |
help=("Enforce resources only for the specified list " |
60 | 60 |
"of users, e.g uuid1,uuid2")), |
61 |
make_option("--exclude-users", |
|
62 |
help=("Exclude list of users from resource enforcement")), |
|
61 | 63 |
make_option("--resources", |
62 | 64 |
help="Specify resources to check, default: %s" % |
63 | 65 |
",".join(DEFAULT_RESOURCES)), |
... | ... | |
115 | 117 |
if users is not None: |
116 | 118 |
users = users.split(',') |
117 | 119 |
|
120 |
excluded = options['exclude_users'] |
|
121 |
excluded = set(excluded.split(',') if excluded is not None else []) |
|
122 |
|
|
118 | 123 |
handlers = self.get_handlers(options["resources"]) |
119 | 124 |
try: |
120 | 125 |
qh_holdings = util.get_qh_users_holdings(users) |
... | ... | |
134 | 139 |
actual_resources = enforce.get_actual_resources(resource_type, |
135 | 140 |
users) |
136 | 141 |
for user, user_quota in qh_holdings: |
142 |
if user in excluded: |
|
143 |
continue |
|
137 | 144 |
for source, source_quota in user_quota.iteritems(): |
138 | 145 |
try: |
139 | 146 |
qh = util.transform_quotas(source_quota) |
Also available in: Unified diff