Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
3e941c3a
Commit
3e941c3a
authored
Apr 15, 2013
by
Christos Stavrakakis
Browse files
Add ASTAKOS_URL to pithos.api.settings
parent
134e03c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
snf-pithos-app/pithos/api/functions.py
View file @
3e941c3a
...
...
@@ -62,7 +62,7 @@ from pithos.api.util import (
)
from
pithos.api.settings
import
(
UPDATE_MD5
,
TRANSLATE_UUIDS
,
SERVICE_TOKEN
)
SERVICE_TOKEN
,
ASTAKOS_URL
)
from
pithos.backends.base
import
(
NotAllowedError
,
QuotaError
,
ContainerNotEmpty
,
ItemNotExists
,
...
...
@@ -78,7 +78,7 @@ logger = logging.getLogger(__name__)
def
get_uuids
(
names
):
try
:
url
=
settings
.
ASTAKOS_URL
+
"/service/api/user_catalogs"
url
=
ASTAKOS_URL
+
"/service/api/user_catalogs"
uuids
=
_get_uuids
(
SERVICE_TOKEN
,
names
,
url
=
url
)
except
Exception
,
e
:
logger
.
exception
(
e
)
...
...
snf-pithos-app/pithos/api/settings.py
View file @
3e941c3a
#coding=utf8
from
django.conf
import
settings
ASTAKOS_URL
=
getattr
(
settings
,
"ASTAKOS_URL"
,
"https://accounts.example.synnefo.org/"
)
COOKIE_NAME
=
getattr
(
settings
,
'PITHOS_ASTAKOS_COOKIE_NAME'
,
'_pithos2_a'
)
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
...
...
snf-pithos-app/pithos/api/util.py
View file @
3e941c3a
...
...
@@ -57,6 +57,7 @@ from pithos.api.settings import (BACKEND_DB_MODULE, BACKEND_DB_CONNECTION,
BACKEND_QUEUE_EXCHANGE
,
USE_QUOTAHOLDER
,
QUOTAHOLDER_URL
,
QUOTAHOLDER_TOKEN
,
QUOTAHOLDER_POOLSIZE
,
ASTAKOS_URL
,
BACKEND_QUOTA
,
BACKEND_VERSIONING
,
BACKEND_FREE_VERSIONING
,
BACKEND_POOL_SIZE
,
COOKIE_NAME
,
USER_CATALOG_URL
,
...
...
@@ -1002,7 +1003,7 @@ def update_response_headers(request, response):
def
get_pithos_usage
(
token
):
"""Get Pithos Usage from astakos."""
astakos_url
=
settings
.
ASTAKOS_URL
+
"im/authenticate"
astakos_url
=
ASTAKOS_URL
+
"im/authenticate"
user_info
=
user_for_token
(
token
,
astakos_url
,
usage
=
True
)
usage
=
user_info
.
get
(
"usage"
,
[])
for
u
in
usage
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment