Commit a7e3126c authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Move astakos lib from snf-common to snf-django-lib

parent 3ceb97e6
......@@ -96,7 +96,7 @@ class Command(object):
if email_re.match(self.user):
try:
from synnefo.lib.astakos import get_user_uuid
from snf_django.lib.astakos import get_user_uuid
from pithos.api.settings import SERVICE_TOKEN
self.user = get_user_uuid(SERVICE_TOKEN, self.user)
except ImportError:
......
......@@ -47,7 +47,7 @@ from synnefo.lib.utils import case_unique
from synnefo.db.models import Network, VirtualMachine
from synnefo.ui.userdata.models import PublicKeyPair
from synnefo.lib import astakos
from snf_django.lib import astakos
def warn(*msgs):
print "WARNING: %s" % ' '.join(msgs)
......
......@@ -36,7 +36,7 @@ from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from synnefo.lib.utils import merge_time
from synnefo.lib.astakos import UserCache
from snf_django.lib.astakos import UserCache
from synnefo.logic.rapi import GanetiApiError
from synnefo.management.common import Omit
from synnefo.management import common
......
......@@ -35,7 +35,7 @@ from django.core.management.base import CommandError
from synnefo.webproject.management.commands import SynnefoCommand
from synnefo.management.common import (format_vm_state, get_vm,
get_image)
from synnefo.lib.astakos import UserCache
from snf_django.lib.astakos import UserCache
from synnefo.settings import (CYCLADES_ASTAKOS_SERVICE_TOKEN as ASTAKOS_TOKEN,
ASTAKOS_URL)
from synnefo.webproject.management import utils
......
......@@ -62,7 +62,7 @@ from synnefo.db.models import (Flavor, VirtualMachine, VirtualMachineMetadata,
BridgePoolTable, MacPrefixPoolTable)
from synnefo.db.pools import EmptyPool
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
from synnefo.plankton.utils import image_backend
from synnefo.settings import MAX_CIDR_BLOCK
......
......@@ -92,7 +92,7 @@ class HelpdeskTests(TestCase):
return None
# mock the astakos authentication function
from synnefo.lib import astakos
from snf_django.lib import astakos
astakos.get_user = get_user_mock
astakos.get_displayname = get_displayname_mock
astakos.get_user_uuid = get_uuid_mock
......
......@@ -43,9 +43,9 @@ from django.core.urlresolvers import reverse
from urllib import unquote
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
from synnefo.db.models import VirtualMachine, NetworkInterface, Network
from synnefo.lib import astakos
from snf_django.lib import astakos
# server actions specific imports
from synnefo.api import servers
......
......@@ -41,7 +41,7 @@ from synnefo.management.common import get_network, Omit
from synnefo.db.models import (Backend, BackendNetwork,
pooled_rapi_client)
from synnefo.logic.rapi import GanetiApiError
from synnefo.lib.astakos import UserCache
from snf_django.lib.astakos import UserCache
from synnefo.settings import (CYCLADES_ASTAKOS_SERVICE_TOKEN as ASTAKOS_TOKEN,
ASTAKOS_URL)
from util import pool_map_chunks
......
......@@ -62,7 +62,7 @@ from django.conf import settings
from pithos.backends.base import NotAllowedError
import synnefo.lib.astakos as lib_astakos
import snf_django.lib.astakos as lib_astakos
import logging
from synnefo.settings import (CYCLADES_USE_QUOTAHOLDER,
......
......@@ -40,7 +40,7 @@ from django.http import (HttpResponse, HttpResponseBadRequest,
HttpResponseServerError, HttpResponseForbidden)
from snf_django.lib.api import faults
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
from synnefo.plankton.backend import (ImageBackend, BackendException,
NotAllowedError)
......
......@@ -41,7 +41,7 @@ from django.http import HttpResponse
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
from django.conf import settings
# base view class
......
......@@ -60,7 +60,7 @@ class TestRestViews(TransactionTestCase):
request.user = {'uniq': 'test'}
# mock the astakos authentication function
from synnefo.lib import astakos
from snf_django.lib import astakos
astakos.get_user = get_user_mock
settings.SKIP_SSH_VALIDATION = True
......
......@@ -40,7 +40,7 @@ from django.conf import settings
from synnefo.ui.userdata import rest
from synnefo.ui.userdata.models import PublicKeyPair
from synnefo.ui.userdata.util import exportKey
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
SUPPORT_GENERATE_KEYS = True
try:
......
......@@ -49,7 +49,7 @@ from django.template import RequestContext
from synnefo.util.version import get_component_version
from synnefo.lib.astakos import get_user
from snf_django.lib.astakos import get_user
SYNNEFO_JS_LIB_VERSION = get_component_version('app')
......
......@@ -40,7 +40,7 @@ from django.utils.http import parse_etags
from django.utils.encoding import smart_str
from django.views.decorators.csrf import csrf_exempt
from synnefo.lib.astakos import get_user, get_uuids as _get_uuids
from snf_django.lib.astakos import get_user, get_uuids as _get_uuids
from snf_django.lib import api
from snf_django.lib.api import faults
......
......@@ -46,7 +46,7 @@ from django.core.files.uploadhandler import FileUploadHandler
from django.core.files.uploadedfile import UploadedFile
from snf_django.lib.api.parsedate import parse_http_date_safe, parse_http_date
from synnefo.lib.astakos import user_for_token
from snf_django.lib.astakos import user_for_token
from snf_django.lib import api
from snf_django.lib.api import faults, utils
......@@ -67,7 +67,7 @@ from pithos.api.settings import (BACKEND_DB_MODULE, BACKEND_DB_CONNECTION,
PUBLIC_URL_ALPHABET)
from pithos.backends.base import (NotAllowedError, QuotaError, ItemNotExists,
VersionNotExists)
from synnefo.lib.astakos import (get_user_uuid, get_displayname,
from snf_django.lib.astakos import (get_user_uuid, get_displayname,
get_uuids, get_displaynames)
import logging
......
......@@ -13,7 +13,7 @@ down_revision = '3dd56e750a3'
from alembic import op
from sqlalchemy.sql import table, column, literal, and_
from synnefo.lib.astakos import get_user_uuid, get_displayname as get_user_displayname
from snf_django.lib.astakos import get_user_uuid, get_displayname as get_user_displayname
from pithos.api.settings import (
SERVICE_TOKEN, USER_CATALOG_URL, AUTHENTICATION_USERS)
......
......@@ -37,7 +37,7 @@ from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import FieldError
from synnefo.webproject.management import utils
from synnefo.lib.astakos import UserCache
from snf_django.lib.astakos import UserCache
class SynnefoCommand(BaseCommand):
......
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