commit a6d167c189419a77dbd97e78773c046a3acba3b3
Author: Giorgos Korfiatis <gkorf@grnet.gr>
Date:   Tue Feb 25 18:40:12 2014 +0200

    astakos: Use SynnefoCommand to handle unicode
    
    Replace BaseCommand with SynnefoCommand in mngt commands. The latter
    properly handles unicode strings.

diff --git a/snf-astakos-app/astakos/im/management/commands/authpolicy-add.py b/snf-astakos-app/astakos/im/management/commands/authpolicy-add.py
index a5469b6..f505e03 100644
--- a/snf-astakos-app/astakos/im/management/commands/authpolicy-add.py
+++ b/snf-astakos-app/astakos/im/management/commands/authpolicy-add.py
@@ -35,11 +35,11 @@ import string
 
 from optparse import make_option
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im.models import AuthProviderPolicyProfile as Profile
 
-option_list = list(BaseCommand.option_list) + [
+option_list = list(SynnefoCommand.option_list) + [
     make_option('--update',
                 action='store_true',
                 dest='update',
@@ -68,7 +68,7 @@ for p in POLICIES:
                                    help="%s policy" % p.title()))
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<name> <provider_name>"
     help = "Create a new authentication provider policy profile"
     option_list = option_list
diff --git a/snf-astakos-app/astakos/im/management/commands/authpolicy-remove.py b/snf-astakos-app/astakos/im/management/commands/authpolicy-remove.py
index 8cbe367..7a50b86 100644
--- a/snf-astakos-app/astakos/im/management/commands/authpolicy-remove.py
+++ b/snf-astakos-app/astakos/im/management/commands/authpolicy-remove.py
@@ -31,16 +31,16 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im.models import AuthProviderPolicyProfile as Profile
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<profile_name>"
     help = "Remove an authentication provider policy"
 
-    option_list = BaseCommand.option_list + ()
+    option_list = SynnefoCommand.option_list + ()
 
     def handle(self, *args, **options):
         if len(args) != 1:
diff --git a/snf-astakos-app/astakos/im/management/commands/authpolicy-set.py b/snf-astakos-app/astakos/im/management/commands/authpolicy-set.py
index b6f88e6..08e46fe 100644
--- a/snf-astakos-app/astakos/im/management/commands/authpolicy-set.py
+++ b/snf-astakos-app/astakos/im/management/commands/authpolicy-set.py
@@ -34,12 +34,12 @@
 from optparse import make_option
 
 from django.db import transaction
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im.models import AuthProviderPolicyProfile as Profile
 from astakos.im.models import AstakosUser, Group
 
-option_list = BaseCommand.option_list + (
+option_list = SynnefoCommand.option_list + (
     make_option('--group',
                 action='append',
                 dest='groups',
@@ -63,7 +63,7 @@ def update_profile(profile, users, groups):
     profile.users.add(*users)
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<name> <provider_name>"
     help = "Assign an existing authentication provider policy profile to " + \
            "a user or group. All previously set "
diff --git a/snf-astakos-app/astakos/im/management/commands/component-add.py b/snf-astakos-app/astakos/im/management/commands/component-add.py
index 538234f..35ef7cd 100644
--- a/snf-astakos-app/astakos/im/management/commands/component-add.py
+++ b/snf-astakos-app/astakos/im/management/commands/component-add.py
@@ -32,15 +32,15 @@
 # or implied, of GRNET S.A.
 
 from optparse import make_option
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from astakos.im.models import Component
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<name>"
     help = "Register a component"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--ui-url',
                     dest='ui_url',
                     default=None,
diff --git a/snf-astakos-app/astakos/im/management/commands/component-modify.py b/snf-astakos-app/astakos/im/management/commands/component-modify.py
index 6443fb4..3a9b6d4 100644
--- a/snf-astakos-app/astakos/im/management/commands/component-modify.py
+++ b/snf-astakos-app/astakos/im/management/commands/component-modify.py
@@ -33,16 +33,16 @@
 
 from optparse import make_option
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im.models import Component
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<component ID or name>"
     help = "Modify component attributes"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--ui-url',
                     dest='ui_url',
                     default=None,
diff --git a/snf-astakos-app/astakos/im/management/commands/component-remove.py b/snf-astakos-app/astakos/im/management/commands/component-remove.py
index b6db662..6064d51 100644
--- a/snf-astakos-app/astakos/im/management/commands/component-remove.py
+++ b/snf-astakos-app/astakos/im/management/commands/component-remove.py
@@ -31,12 +31,12 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.db import transaction
 from astakos.im.models import Component
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<component ID or name>"
     help = "Remove a component along with its registered services"
 
diff --git a/snf-astakos-app/astakos/im/management/commands/group-add.py b/snf-astakos-app/astakos/im/management/commands/group-add.py
index 7bbeb16..3c1e7e6 100644
--- a/snf-astakos-app/astakos/im/management/commands/group-add.py
+++ b/snf-astakos-app/astakos/im/management/commands/group-add.py
@@ -31,16 +31,16 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im.models import Group
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<group name>"
     help = "Create a group with the given name"
 
-    option_list = BaseCommand.option_list + ()
+    option_list = SynnefoCommand.option_list + ()
 
     def handle(self, *args, **options):
         if len(args) != 1:
diff --git a/snf-astakos-app/astakos/im/management/commands/project-control.py b/snf-astakos-app/astakos/im/management/commands/project-control.py
index d167249..7f50272 100644
--- a/snf-astakos-app/astakos/im/management/commands/project-control.py
+++ b/snf-astakos-app/astakos/im/management/commands/project-control.py
@@ -34,16 +34,16 @@
 from optparse import make_option
 
 from django.db import transaction
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from astakos.im.functions import (terminate, suspend, unsuspend,
                                   reinstate, check_expiration,
                                   approve_application, deny_application)
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     help = "Manage projects and applications"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--approve',
                     dest='approve',
                     metavar='<application id>',
diff --git a/snf-astakos-app/astakos/im/management/commands/project-modify.py b/snf-astakos-app/astakos/im/management/commands/project-modify.py
index e636aff..87de342 100644
--- a/snf-astakos-app/astakos/im/management/commands/project-modify.py
+++ b/snf-astakos-app/astakos/im/management/commands/project-modify.py
@@ -34,7 +34,7 @@
 from optparse import make_option
 
 from django.db.models import Q
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.db import transaction
 from synnefo.util import units
 from astakos.im import functions
@@ -112,10 +112,10 @@ def make_options():
     return tuple(options)
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<project id> (or --all-base-projects)"
     help = "Modify an already initialized project"
-    option_list = BaseCommand.option_list + make_options() + (
+    option_list = SynnefoCommand.option_list + make_options() + (
         make_option('--all-base-projects',
                     action='store_true',
                     default=False,
diff --git a/snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py b/snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py
index d3c24b5..72afa56 100644
--- a/snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py
+++ b/snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py
@@ -34,7 +34,7 @@
 from optparse import make_option
 from datetime import datetime
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.db import transaction
 
 from snf_django.utils import reconcile
@@ -46,7 +46,7 @@ import astakos.quotaholder_app.callpoint as qh
 import astakos.quotaholder_app.exception as qh_exception
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     help = """Reconcile resource usage of Quotaholder with Astakos DB.
 
     Detect unsynchronized usage between Quotaholder and Astakos DB resources
@@ -54,7 +54,7 @@ class Command(BaseCommand):
 
     """
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option("--userid", dest="userid",
                     default=None,
                     help="Reconcile resources only for this user"),
diff --git a/snf-astakos-app/astakos/im/management/commands/resource-modify.py b/snf-astakos-app/astakos/im/management/commands/resource-modify.py
index 91233a6..99a043c 100644
--- a/snf-astakos-app/astakos/im/management/commands/resource-modify.py
+++ b/snf-astakos-app/astakos/im/management/commands/resource-modify.py
@@ -32,7 +32,7 @@
 # or implied, of GRNET S.A.
 
 from optparse import make_option
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from snf_django.management import utils
 from astakos.im.models import Resource
@@ -40,11 +40,11 @@ from astakos.im import register
 from ._common import style_options, check_style, units
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<resource name>"
     help = "Modify a resource's quota defaults and boolean flags."
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--base-default',
                     metavar='<limit>',
                     help="Specify default quota for base projects"),
diff --git a/snf-astakos-app/astakos/im/management/commands/service-import.py b/snf-astakos-app/astakos/im/management/commands/service-import.py
index d2a1b3d..81068c8 100644
--- a/snf-astakos-app/astakos/im/management/commands/service-import.py
+++ b/snf-astakos-app/astakos/im/management/commands/service-import.py
@@ -34,7 +34,7 @@
 from optparse import make_option
 
 from django.db import transaction
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.utils import simplejson as json
 
 from astakos.im.register import add_service, add_resource, RegisterException
@@ -42,10 +42,10 @@ from astakos.im.models import Component
 from ._common import read_from_file
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     help = "Register services"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--json',
                     dest='json',
                     metavar='<json.file>',
diff --git a/snf-astakos-app/astakos/im/management/commands/term-add.py b/snf-astakos-app/astakos/im/management/commands/term-add.py
index 89e6842..a34e88f 100644
--- a/snf-astakos-app/astakos/im/management/commands/term-add.py
+++ b/snf-astakos-app/astakos/im/management/commands/term-add.py
@@ -33,13 +33,13 @@
 
 from os.path import abspath
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.db import transaction
 
 from astakos.im.models import ApprovalTerms, AstakosUser
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<location>"
     help = "Insert approval terms"
 
diff --git a/snf-astakos-app/astakos/im/management/commands/user-activation-send.py b/snf-astakos-app/astakos/im/management/commands/user-activation-send.py
index b7b06ed..38497d1 100644
--- a/snf-astakos-app/astakos/im/management/commands/user-activation-send.py
+++ b/snf-astakos-app/astakos/im/management/commands/user-activation-send.py
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 
 from astakos.im import activation_backends
 activation_backend = activation_backends.get_backend()
@@ -39,7 +39,7 @@ activation_backend = activation_backends.get_backend()
 from ._common import get_user
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<user ID or email> [user ID or email] ..."
     help = "Sends an activation email to one or more users"
 
diff --git a/snf-astakos-app/astakos/im/management/commands/user-add.py b/snf-astakos-app/astakos/im/management/commands/user-add.py
index 16ca7cd..c14995f 100644
--- a/snf-astakos-app/astakos/im/management/commands/user-add.py
+++ b/snf-astakos-app/astakos/im/management/commands/user-add.py
@@ -35,7 +35,7 @@ from optparse import make_option
 from datetime import datetime
 
 from django.db import transaction
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.core.validators import validate_email
 from django.core.exceptions import ValidationError
 
@@ -43,11 +43,11 @@ from astakos.im.models import AstakosUser, get_latest_terms
 from astakos.im.auth import make_local_user
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<email> <first name> <last name>"
     help = "Create a user"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--password',
                     dest='password',
                     metavar='PASSWORD',
diff --git a/snf-astakos-app/astakos/im/management/commands/user-modify.py b/snf-astakos-app/astakos/im/management/commands/user-modify.py
index c967936..62e54e3 100644
--- a/snf-astakos-app/astakos/im/management/commands/user-modify.py
+++ b/snf-astakos-app/astakos/im/management/commands/user-modify.py
@@ -38,7 +38,7 @@ from optparse import make_option
 
 from django.core import management
 from django.db import transaction
-from django.core.management.base import BaseCommand, CommandError
+from snf_django.management.commands import SynnefoCommand, CommandError
 from django.contrib.auth.models import Group
 from django.core.exceptions import ValidationError
 from django.core.validators import validate_email
@@ -50,11 +50,11 @@ from ._common import (remove_user_permission, add_user_permission, is_uuid)
 activation_backend = activation_backends.get_backend()
 
 
-class Command(BaseCommand):
+class Command(SynnefoCommand):
     args = "<user ID> (or --all)"
     help = "Modify a user's attributes"
 
-    option_list = BaseCommand.option_list + (
+    option_list = SynnefoCommand.option_list + (
         make_option('--all',
                     action='store_true',
                     default=False,
