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
9f61dc4d
Commit
9f61dc4d
authored
Jun 12, 2013
by
Christos Stavrakakis
Browse files
Ensure we return cloud faults under any API prefix
parent
9cb2e33b
Changes
7
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/api/keystone_urls.py
View file @
9f61dc4d
...
...
@@ -32,8 +32,10 @@
# or implied, of GRNET S.A.
from
django.conf.urls.defaults
import
patterns
,
url
from
snf_django.lib.api
import
api_endpoint_not_found
urlpatterns
=
patterns
(
'astakos.api.tokens'
,
url
(
r
'^v2.0/tokens/?$'
,
'authenticate'
,
name
=
'tokens_authenticate'
),
url
(
r
'^.*'
,
api_endpoint_not_found
),
)
snf-astakos-app/astakos/api/urls.py
View file @
9f61dc4d
...
...
@@ -32,6 +32,7 @@
# or implied, of GRNET S.A.
from
django.conf.urls.defaults
import
patterns
,
url
,
include
from
snf_django.lib.api
import
api_endpoint_not_found
astakos_account_v1_0
=
patterns
(
...
...
@@ -60,4 +61,5 @@ astakos_account_v1_0 += patterns(
urlpatterns
=
patterns
(
''
,
url
(
r
'^v1.0/'
,
include
(
astakos_account_v1_0
)),
(
r
'^.*'
,
api_endpoint_not_found
),
)
snf-cyclades-app/synnefo/api/common.py
deleted
100644 → 0
View file @
9cb2e33b
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from
snf_django.lib.api
import
faults
from
synnefo.api.util
import
api_method
@
api_method
()
def
not_found
(
request
):
raise
faults
.
BadRequest
(
'Not found.'
)
@
api_method
()
def
method_not_allowed
(
request
):
raise
faults
.
BadRequest
(
'Method not allowed'
)
snf-cyclades-app/synnefo/api/urls.py
View file @
9f61dc4d
...
...
@@ -33,7 +33,7 @@
from
django.conf.urls.defaults
import
include
,
patterns
from
snf_django.lib.api
import
not_found
from
snf_django.lib.api
import
api_endpoint_
not_found
from
synnefo.api
import
servers
,
flavors
,
images
,
networks
from
synnefo.api.versions
import
versions_list
,
version_details
...
...
@@ -56,5 +56,5 @@ urlpatterns = patterns(
(
r
'^v2.0/(?:.json|.xml|.atom)?$'
,
version_details
,
{
'api_version'
:
'v1.1'
}),
(
r
'^v2.0/'
,
include
(
api20_patterns
)),
(
r
'^.
+
'
,
not_found
),
(
r
'^.
*
'
,
api_endpoint_
not_found
),
)
snf-cyclades-app/synnefo/plankton/urls.py
View file @
9f61dc4d
...
...
@@ -33,6 +33,7 @@
from
django.conf.urls.defaults
import
patterns
,
include
from
django.http
import
HttpResponseNotAllowed
from
snf_django.lib.api
import
api_endpoint_not_found
from
synnefo.plankton
import
views
...
...
@@ -90,4 +91,5 @@ image_v1_patterns = patterns(
urlpatterns
=
patterns
(
''
,
(
r
'^v1.0/'
,
include
(
image_v1_patterns
)),
(
r
'^.*'
,
api_endpoint_not_found
),
)
snf-django-lib/snf_django/lib/api/__init__.py
View file @
9f61dc4d
...
...
@@ -210,9 +210,11 @@ def render_fault(request, fault):
return
response
def
not_found
(
request
):
raise
faults
.
BadRequest
(
'Not found.'
)
@
api_method
(
token_required
=
False
,
user_required
=
False
)
def
api_endpoint_not_found
(
request
):
raise
faults
.
BadRequest
(
"API endpoint not found"
)
def
method_not_allowed
(
request
):
@
api_method
(
token_required
=
False
,
user_required
=
False
)
def
api_method_not_allowed
(
request
):
raise
faults
.
BadRequest
(
'Method not allowed'
)
snf-pithos-app/pithos/api/urls.py
View file @
9f61dc4d
...
...
@@ -36,6 +36,7 @@ from django.conf.urls.defaults import include, patterns
from
snf_django.lib.api.proxy
import
proxy
from
snf_django.lib.api.utils
import
prefix_pattern
from
snf_django.lib.api.urls
import
api_patterns
from
snf_django.lib.api
import
api_endpoint_not_found
from
pithos.api.settings
import
(
BASE_PATH
,
ASTAKOS_BASE_URL
,
BASE_ASTAKOS_PROXY_PATH
,
ASTAKOS_ACCOUNTS_PREFIX
,
PROXY_USER_SERVICES
,
...
...
@@ -61,6 +62,8 @@ pithos_patterns = patterns(
''
,
(
r
'{0}v1/'
.
format
(
prefix_pattern
(
PITHOS_PREFIX
)),
include
(
pithos_api_patterns
)),
(
r
'{0}.*'
.
format
(
prefix_pattern
(
PITHOS_PREFIX
)),
api_endpoint_not_found
),
(
r
'{0}(?P<v_public>.+?)/?$'
.
format
(
prefix_pattern
(
PUBLIC_PREFIX
)),
'pithos.api.public.public_demux'
),
(
r
'{0}'
.
format
(
prefix_pattern
(
UI_PREFIX
)),
...
...
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