Commit 95692332 authored by Alex Pyrgiotis's avatar Alex Pyrgiotis
Browse files

admin: Remove unused imports

parent 8820c3dc
......@@ -17,7 +17,6 @@
import functools
from snf_django.lib.api import faults
from astakos.im.functions import ProjectConflict
class AdminAction(object):
......
......@@ -15,19 +15,8 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import IPAddressLog, VirtualMachine
from synnefo.logic import ips
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.queries_common import (query, model_filter,
......
......@@ -15,19 +15,11 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from astakos.im.models import AstakosUser
from synnefo.db.models import IPAddress, VirtualMachine, Network
from synnefo.logic import ips
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
from synnefo_admin.admin.utils import create_details_href
......
......@@ -15,26 +15,12 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.html import escape
from synnefo.db.models import IPAddress, IPAddressLog, VirtualMachine, Network
from synnefo.logic import ips
from astakos.im.models import AstakosUser, Project
import django_filters
from synnefo.db.models import IPAddressLog
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.actions import (has_permission_or_403,
get_allowed_actions,
get_permitted_actions,)
from synnefo_admin.admin.utils import (get_actions, render_email,
_filter_public_ip_log)
from synnefo_admin.admin.utils import _filter_public_ip_log
from synnefo_admin.admin.tables import AdminJSONView
from .utils import (get_user_details_href, get_ip_details_href,
......
......@@ -15,22 +15,11 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import IPAddress
from synnefo.logic import ips
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.actions import AdminAction, noop
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
......@@ -56,10 +45,7 @@ def check_destroy_ip(ip):
def generate_actions():
"""Create a list of actions on ips.
The actions are: activate/deactivate, accept/reject, verify, contact.
"""
"""Create a list of actions on ips."""
actions = OrderedDict()
actions['destroy'] = IPAction(name='Destroy', c=check_destroy_ip,
......
......@@ -15,20 +15,9 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
import django_filters
from synnefo.db.models import IPAddress
from synnefo.logic import ips
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.queries_common import (query, model_filter,
get_model_field)
......
......@@ -15,20 +15,11 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from astakos.im.models import AstakosUser
from synnefo.db.models import IPAddress, IPAddressLog
from synnefo.logic import ips
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.utils import create_details_href
......
......@@ -15,24 +15,12 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import (Network, VirtualMachine, NetworkInterface,
IPAddress)
from synnefo.logic.networks import validate_network_action
from synnefo.logic import networks
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.actions import AdminAction, noop
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
......@@ -74,10 +62,7 @@ def check_network_action(action):
def generate_actions():
"""Create a list of actions on networks.
The actions are: activate/deactivate, accept/reject, verify, contact.
"""
"""Create a list of actions on networks."""
actions = OrderedDict()
actions['drain'] = NetworkAction(name='Drain', f=drain_network,
......
......@@ -15,25 +15,10 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import (Network, VirtualMachine, NetworkInterface,
IPAddress)
from synnefo.logic.networks import validate_network_action
from synnefo.logic import networks
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
from synnefo.db.models import Network
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.queries_common import (query, model_filter,
get_model_field)
......
......@@ -15,27 +15,13 @@
import logging
import re
from collections import OrderedDict
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import (Network, VirtualMachine, NetworkInterface,
IPAddress)
from synnefo.logic.networks import validate_network_action
from synnefo.logic import networks
from astakos.im.user_utils import send_plain as send_email
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from astakos.im.models import AstakosUser
from synnefo.db.models import Network
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.utils import create_details_href
......
......@@ -15,37 +15,13 @@
import logging
import re
from collections import OrderedDict
from operator import itemgetter
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import (VirtualMachine, Network, Volume,
NetworkInterface, IPAddress)
from astakos.im.models import (AstakosUser, Project, ProjectResourceGrant,
Resource)
from eztables.views import DatatablesView
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403,
AdminActionCannotApply)
from astakos.im.functions import (validate_project_action, ProjectConflict,
from synnefo_admin.admin.actions import AdminAction
from astakos.im.functions import (validate_project_action,
approve_application, deny_application,
suspend, unsuspend, terminate, reinstate)
from astakos.im.quotas import get_project_quota
from synnefo.util import units
import django_filters
from django.db.models import Q
from synnefo_admin.admin.utils import is_resource_useful
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
......@@ -127,7 +103,7 @@ def generate_actions():
actions['unsuspend'] = ProjectAction(name='Unsuspend',
f=do_project_action("unsuspend"),
c=check_project_action("UNSUSPEND"),
karma='good', caution_level='warning',)
karma='good', caution_level='warning')
actions['terminate'] = ProjectAction(name='Terminate',
f=do_project_action("terminate"),
......
......@@ -15,39 +15,15 @@
import logging
import re
from collections import OrderedDict
from operator import itemgetter
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from synnefo.db.models import (VirtualMachine, Network, Volume,
NetworkInterface, IPAddress)
from astakos.im.models import (AstakosUser, Project, ProjectResourceGrant,
Resource)
from eztables.views import DatatablesView
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from astakos.im.user_utils import send_plain as send_email
from astakos.im.functions import (validate_project_action, ProjectConflict,
approve_application, deny_application,
suspend, unsuspend, terminate, reinstate)
from astakos.im.models import Project
from astakos.im.quotas import get_project_quota
from synnefo.util import units
import django_filters
from django.db.models import Q
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.utils import get_resource, is_resource_useful
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.utils import is_resource_useful
def get_actual_owner(inst):
......
......@@ -14,40 +14,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re
from collections import OrderedDict
from operator import or_
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group
from django.template import Context, Template
from django.core.urlresolvers import set_urlconf
from synnefo.db.models import (VirtualMachine, Network, IPAddressLog, Volume,
NetworkInterface, IPAddress)
from astakos.im.models import AstakosUser, ProjectMembership, Project, Resource
from astakos.im import user_logic as users
from synnefo.db.models import VirtualMachine
from astakos.im.models import AstakosUser, Project
from astakos.im.quotas import get_user_quotas
from astakos.im.user_utils import send_plain as send_email
from synnefo.util import units
from eztables.views import DatatablesView
import django_filters
from django.db.models import Q
from synnefo_admin import admin_settings
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.utils import (get_resource, is_resource_useful,
create_details_href)
UUID_SEARCH_REGEX = re.compile('([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})')
class DefaultUrlConf(object):
......
......@@ -40,8 +40,7 @@ from synnefo.admin import stats as cyclades_stats
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin_settings import (ADMIN_MEDIA_URL, AUTH_COOKIE_NAME,
ADMIN_PERMITTED_GROUPS,
ADMIN_ENABLED, ADMIN_VIEWS)
ADMIN_PERMITTED_GROUPS, ADMIN_VIEWS)
from synnefo_admin import admin_settings
from synnefo_admin.admin import actions
......
......@@ -14,26 +14,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re
from collections import OrderedDict
from operator import or_
from django.core.urlresolvers import reverse
from django.db.models import Q
from synnefo.db.models import VirtualMachine, Network, IPAddressLog
from astakos.im.models import AstakosUser, ProjectMembership, Project
from synnefo.logic import servers as servers_backend
from synnefo.logic.commands import validate_server_action
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.actions import (AdminAction, noop)
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
......
......@@ -14,29 +14,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re
from collections import OrderedDict
from operator import or_
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.conf import settings
from synnefo.db.models import (VirtualMachine, Network, Volume, IPAddress,
IPAddressLog)
from astakos.im.models import AstakosUser, ProjectMembership, Project
from astakos.im.user_utils import send_plain as send_email
from synnefo.logic import servers as servers_backend
from synnefo.logic.commands import validate_server_action
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo.db.models import VirtualMachine
from synnefo_admin.admin.queries_common import (query, model_filter,
get_model_field)
......
......@@ -14,30 +14,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re
from collections import OrderedDict
from operator import or_
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.db.models import Q
from synnefo.db.models import VirtualMachine, Network, IPAddressLog
from astakos.im.models import AstakosUser, ProjectMembership, Project
from astakos.im.user_utils import send_plain as send_email
from synnefo.logic import servers as servers_backend
from synnefo.logic.commands import validate_server_action
from eztables.views import DatatablesView
import django_filters
from astakos.im.models import AstakosUser
from synnefo.db.models import VirtualMachine
from synnefo_admin.admin.exceptions import AdminHttp404
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.utils import create_details_href
......
......@@ -17,17 +17,7 @@
import logging
from collections import OrderedDict
from django.core.urlresolvers import reverse
from synnefo.db.models import Volume
from astakos.im.models import AstakosUser, Project
from eztables.views import DatatablesView
import django_filters
from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403)
from synnefo_admin.admin.actions import AdminAction
from synnefo_admin.admin.utils import update_actions_rbac, send_admin_email
......@@ -45,10 +35,7 @@ class VolumeAction(AdminAction):
def generate_actions():
"""Create a list of actions on volumes.
The actions are: activate/deactivate, accept/reject, verify, contact.
"""
"""Create a list of actions on volumes."""
actions = OrderedDict()
actions['contact'] = VolumeAction(name='Send e-mail', f=send_admin_email,)
......
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