Commit 57328c5d authored by Sofia Papagiannaki's avatar Sofia Papagiannaki

pithos: Fix pithos-manage-account command

* Set DJANGO_SETINGS_MODULE
* Disable by default failure reports
  during container quota updates
parent b0b3b0ff
......@@ -31,12 +31,14 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from pithos.api.util import get_backend, split_container_object_string
import re
import hashlib
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'synnefo.settings'
from pithos.api.util import get_backend, split_container_object_string
def data_read_iterator(str, size=1024):
offset = 0
......
......@@ -152,7 +152,7 @@ def set_container_quota(args):
failed.append((account, e))
map(update_container_policy, accounts)
if failed:
if failed and args.report:
sys.stdout.write(
'Failed for the following accounts:\n'
)
......@@ -227,6 +227,10 @@ def main(argv=None):
'--dry', action="store_true", default=False,
help="Do not commit database changes."
)
parser_set_container_quota.add_argument(
'--report', action="store_true", default=False,
help="Report failures."
)
parser_set_container_quota.add_argument('container')
parser_set_container_quota.add_argument('quota')
parser_set_container_quota.set_defaults(func=set_container_quota)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment