Revision d9a7f0bb snf-cyclades-app/synnefo/quotas/management/commands/enforce-resources-cyclades.py
b/snf-cyclades-app/synnefo/quotas/management/commands/enforce-resources-cyclades.py | ||
---|---|---|
77 | 77 |
) |
78 | 78 |
|
79 | 79 |
def confirm(self): |
80 |
self.stderr.write("Confirm? [y/N] ")
|
|
80 |
self.stdout.write("Confirm? [y/N] ")
|
|
81 | 81 |
response = raw_input() |
82 | 82 |
if string.lower(response) not in ['y', 'yes']: |
83 |
self.stdout.write("Aborted.\n")
|
|
83 |
self.stderr.write("Aborted.\n")
|
|
84 | 84 |
exit() |
85 | 85 |
|
86 | 86 |
def get_handlers(self, resources): |
... | ... | |
180 | 180 |
return |
181 | 181 |
|
182 | 182 |
headers = ("#", "User", "Source", "Resource", "Limit", "Usage") |
183 |
pprint_table(self.stderr, overlimit, headers,
|
|
183 |
pprint_table(self.stdout, overlimit, headers,
|
|
184 | 184 |
options["output_format"], title="Violations") |
185 | 185 |
|
186 | 186 |
if any(actions.values()): |
187 |
write("\n") |
|
187 |
self.stdout.write("\n")
|
|
188 | 188 |
if fix: |
189 | 189 |
if dangerous and not force: |
190 | 190 |
write("You are enforcing resources that may permanently " |
... | ... | |
197 | 197 |
headers = ("Type", "ID", "State", "Backend", "Action", "Violation") |
198 | 198 |
if fix: |
199 | 199 |
headers += ("Result",) |
200 |
pprint_table(self.stderr, log, headers,
|
|
200 |
pprint_table(self.stdout, log, headers,
|
|
201 | 201 |
options["output_format"], title=title) |
Also available in: Unified diff