Commit a80d4e96 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Cleanup and pep8 fixes in commands

parent b3ef0fed
......@@ -31,18 +31,14 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from datetime import datetime
import uuid
from django.core.validators import validate_email
from django.utils.timesince import timesince, timeuntil
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.core.management import CommandError
from synnefo.util import units
from synnefo.lib.ordereddict import OrderedDict
from astakos.im.models import AstakosUser
from astakos.im.register import get_resources
import sys
......@@ -68,7 +64,7 @@ def get_user(email_or_id, **kwargs):
return AstakosUser.objects.get(id=int(email_or_id))
else:
return AstakosUser.objects.get(email__iexact=email_or_id, **kwargs)
except AstakosUser.DoesNotExist, AstakosUser.MultipleObjectsReturned:
except (AstakosUser.DoesNotExist, AstakosUser.MultipleObjectsReturned):
return None
......
......@@ -109,7 +109,6 @@ class Command(BaseCommand):
policy = policy.replace('unset_', '')
setattr(profile, policy, None)
profile.save()
if update:
print "Profile updated"
......
......@@ -87,7 +87,6 @@ class Command(BaseCommand):
if not any([url, auth_token, renew_token, purge_services]):
raise CommandError("No option specified.")
if url:
component.url = url
......
......@@ -34,12 +34,10 @@
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from django.utils import simplejson as json
from snf_django.lib.db.transaction import commit_on_success_strict
from astakos.im.register import add_resource, ResourceException
from astakos.im.models import Service
from ._common import read_from_file
......
......@@ -34,7 +34,6 @@
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from django.utils import simplejson as json
from snf_django.lib.db.transaction import commit_on_success_strict
......
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