Statistics
| Branch: | Tag: | Revision:

root / snf-django-lib @ 72cbea06

# Date Author Comment
72cbea06 02/26/2014 09:19 pm Christos Stavrakakis

snf_django: Use 'replace' error strategy

Make custom CommandError use 'replace' strategy for unicodes that cannot
be decoded to user's preferred encoding.

fb8357c8 02/26/2014 06:03 pm Giorgos Korfiatis

snf_django: Fix csv unicode writer

Use recipe from http://docs.python.org/2/library/csv.html to write unicode
in csv format.

1e285210 02/26/2014 06:03 pm Giorgos Korfiatis

snf_django: Handle unicode in CommandError

Define a custom CommandError, which applies smart_locale_str() in its
str method.

4267cb32 02/26/2014 12:43 pm Christos Stavrakakis

snf_django: Fix alignment in pprint_table command

Alignment was broken from new code that decoded table fields using
user's encoding, since len() function will count length of bytes and not
characters. This commit fixes by making pprint_table work only with...

857f8a2f 02/25/2014 05:58 pm Christos Stavrakakis

snf_django: Fix unicode decoding in SynnefoCommand

Some options of snf-manage commands maybe list or tuples. Applying
'smart_unicode' to them will convert them to unicode object. Instead
of recursively converting data, we convert the arguments to unicodes...

51e5aa11 02/24/2014 02:12 pm Christos Stavrakakis

snf_django: Fix typo

1ed138e8 02/24/2014 01:41 pm Christos Stavrakakis

snf_django: Revert wrong change in exclude list

Revert way that 'exclude' is called, from commit #99955a0.

8c911970 02/24/2014 01:14 pm Christos Stavrakakis

cyclades: s/BaseCommand/SynnefoCommand

Replace use of BaseCommand with SynnefoCommand which will convert the
arguments/options to unicode objects.

99955a02 02/24/2014 01:07 pm Christos Stavrakakis

snf_django: Handle unicodes in SynnefoCommand

Extend SynnefoCommand to override 'run_from_argv' function in order
to decode command line argumuents and options, using the user's
preferred encoding.

91c788ec 02/24/2014 01:05 pm Christos Stavrakakis

snf_django: Add utils function to handle unicodes

Add utils functions to handle unicode objects from 'snf-manage' using
the user's preferred encoding. Also add 'safe_string' function to
escape control characters from strings and unicode objects.

2e90e666 02/24/2014 12:49 pm Christos Stavrakakis

Replace use of 'udec' with 'smart_unicode'

01c660b6 02/21/2014 04:07 pm Christos Stavrakakis

snf_django: Replace uenc with smart_unicode

c4e22972 02/21/2014 04:05 pm Christos Stavrakakis

snf_django: Explicitly set encoding of requests

Explicitly set request encoding to UTF-8 instead of relying
DEFAULT_CHARSET setting. See:
https://docs.djangoproject.com/en/1.4/ref/unicode/#form-submission

5a6cee09 02/21/2014 04:05 pm Christos Stavrakakis

snf_django: Handle unicode errors in JSON bodies

Catch unicode errors when JSON deserializing the body of a request.
Also, rename 'get_request_dict' function to 'get_json_body', as it is a
more represenative name for what the function is doing.

c8922d01 02/20/2014 04:41 pm Giorgos Korfiatis

snf_django: Properly chain `exclude' queries

Although chained filters, e.g. filter(p1).filter(p2), can be summed up as
filter(p1, p2), this is not the case with exclude. If you want to exclude
those selected by p1 as well as those selected by p2, you need...

787f7372 02/13/2014 04:20 pm Giorgos Korfiatis

snf_django: Fix select_related in ListCommand

Pass all related fields in a single call, because select_related does not
chain as expected (yet). See https://code.djangoproject.com/ticket/16855

Also pass prefetch_related in a uniform way.

b1f6aea8 02/13/2014 04:20 pm Giorgos Korfiatis

snf_django: Factor out resource reconcile

Generalize the checks operated during resource reconciliation so that they
can be used in all Synnefo components.

Adapt checks for user/project limits, include checks for project limits.

78e1f8da 02/13/2014 04:20 pm Sofia Papagiannaki

pithos: Add support for project originated quota

Introduce ``project`` container policy. The value of this policy denotes
the project from which the container quota originate.

Further changes:
  • domain argument in get_{account|container|object}_meta backend methods...
14402edc 01/24/2014 07:12 pm Christos Stavrakakis

cyclades: Validate fields of API requests

Make sure that all fields of a request (user input) have a valid type.
This commit validates 'ports', 'servers' and 'floating_ips' APIs.

Refs #4979

ba777b02 01/23/2014 03:44 pm Giorgos Korfiatis

cyclades: Detach serial from resource when resolved

4845dfaa 01/23/2014 11:02 am Christos Stavrakakis

snf_django: Fix bug in list commands

Fix bug in Synnefo ListCommand where you could not select to print only
the user email columnd ('-o user.email').

f9d665e4 01/20/2014 01:39 pm Christos Stavrakakis

astakos: Fix bug in Astakos stats view

'ASTAKOS_AUTH_URL' setting is not present in Astakos node.

dd21b1c4 12/10/2013 01:52 pm Kostas Papadimitriou

django-lib: redirect option in proxy util

If set to True proxy view will return an http redirect response to the
corresponding target location.

Signed-off-by: Kostas Papadimitriou <>
Signed-off-by: Ilias Tsitsimpis <>

2aba7764 12/03/2013 02:44 pm Sofia Papagiannaki

snf_django: Change error status code if request method is not valid

Return 405 (NotAllowed) instead of 400 (BadRequest)
Add Allow header in the response containing the list of valid methods

48233747 12/02/2013 04:52 pm Christos Stavrakakis

snf_django: Add new filtering fuction

Add new 'filter_objects_results' function to apply filters, e.g. from
--filter-by option to objects. Rename old 'parse_filters' function ,that
parsed filters to querytset arguments, to 'parse_queryset_filters.
The new function is currently unused.

2052c40e 12/02/2013 04:52 pm Christos Stavrakakis

cyclades: Optimize server-list command

Optimize server-list command by prefetching related fields if needed.

85ddc6a3 11/29/2013 01:34 pm Christos Stavrakakis

snf_django: Fix typo in --output-format help text

c20a9da5 11/28/2013 01:36 pm Christos Stavrakakis

snf_django: Log all 5xx to 'django.request'

Change api_method decorator to log besides unhandled exceptions, all
5xx API responses to 'django.request'.

93505a12 11/28/2013 01:30 pm Christos Stavrakakis

snf_django: Log exceptions to 'django.request'

Change api_method decorator to log unhandled exception in
'django.request' handler in order to match with Django's default
behaviour to log unhandled exceptions as 'error' in 'django.request' and
sent mail to admins for such cases.

aad21b81 11/27/2013 08:12 pm Christos Stavrakakis

snf_django: Propper logging of unexpected errors

Extend logging of unexpected errors, in 'api_method' decorator to
include the request and the status code in the log record, in order to
be properly displayed by Django's AdminMailHandler.

c406d7d9 11/25/2013 01:13 pm Dionysis Grigoropoulos

django: Add a RemoveCommand class

  • Add a new class for snf-manage *-remove commands
0f89715b 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Update some snf-manage commands

  • Update network-remove, server-remove, floating-ip-remove, port-remove
    to extend RemoveCommand class added in commit
    ec15e2ab68f90dcc7310863c9293708055fbfb7d
d27b16cc 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Verbal fixes on some snf-manage commands

83157287 11/25/2013 01:13 pm Dionysis Grigoropoulos

Add a new function to assert success code 201

  • Add assertSuccess201 function
  • Use this new function in test/subnets.py
d9f2a9e1 11/21/2013 01:28 pm Christos Stavrakakis

cyclades: Command to export Cyclades statistics

Add new 'snf-manage stats-cyclades' management command to export basic
statistics about Cyclades, like number of servers, network and resource
utilization. The command can either export the statistics either in JSON...

bda47e03 11/21/2013 01:28 pm Christos Stavrakakis

cyclades: Export Cyclades detailed stats from API

Add '/admin/stats/detail' API endpoint to export basic statistics about
Cyclades. Access to this view is only allowed to the users that belong
to specific Astakos groups, as specified in the new setting
'ADMIN_STATS_PERMITTED_GROUPS.' Also, added the new 'user_in_groups' API...

78c79ac7 11/14/2013 06:17 pm Giorgos Korfiatis

snf_django: Impose ordering on operator parsing

Turn the dict of operators to a list to make sure a certain ordering is
preserved.

a1dae38d 11/12/2013 01:34 pm Christos Stavrakakis

Merge branch 'feature-cyclades-networks' into develop

Conflicts:
snf-cyclades-app/synnefo/api/management/commands/server-inspect.py
snf-cyclades-app/synnefo/app_settings/urls.py
snf-cyclades-app/synnefo/logic/backend.py
snf-cyclades-app/synnefo/logic/backend_allocator.py...

3b6afb38 11/07/2013 04:28 pm Christos Stavrakakis

snf-django: Optimize DB queries in ListCommand

Add options to use 'prefetch_related' and 'select_related' options of
Django queries to optimize the DB queries.

f019f93d 10/29/2013 05:10 pm Ilias Tsitsimpis

Fix pep8 errors

837d85bb 10/29/2013 04:15 pm Ilias Tsitsimpis

astakosclient: Usage request parameter deprecated

Astakos' Authenticate Api Method has deprecated the `usage' request
parameter. Remove it from AstakosClient.

45c0bcf8 10/29/2013 04:15 pm Giorgos Korfiatis

astakosclient: Separate public/private POST /tokens

Introduce function authenticate(), which performs POST /tokens in
private mode, i.e. giving a token to be checked for authentication.
Function get_endpoints() performs the call in public mode, in order
to retrieve the endpoints....

b4b82ec4 10/29/2013 04:15 pm Giorgos Korfiatis

astakos: Remove call GET /authenticate

Use POST /tokens to authenticate. Delete AstakosClient.get_user_info()
and replace its uses by AstakosClient.authenticate().

ef57e622 10/29/2013 03:37 pm Ilias Tsitsimpis

django-lib: Use the new AstakosClient

a859190b 10/29/2013 02:57 pm Christos Stavrakakis

cyclades: Fix output of network-inspect command

2ef199c9 10/14/2013 05:42 pm Dionysis Grigoropoulos

django-lib: Add assertConflict (409) in testing.py

fde2c1f7 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Fix the os-floating-ips API

Rewrite the of-floating-ips API to match with the new DB schema.

a96e84cf 10/10/2013 08:08 pm Christos Stavrakakis

cyclades: Fix code for networks logic and API

5b8a9240 10/10/2013 08:08 pm Christos Stavrakakis

cyclades: Fix and add new tests for /networks

Also, delete tests for old networks.

c7e03d20 10/09/2013 04:52 pm Giorgos Korfiatis

astakos: Remove custom ForUpdateManager

Remove custom manager that implemented select_for_update(), since this
is already implemented in Django 1.4.

a3e3917f 10/09/2013 04:52 pm Giorgos Korfiatis

astakos: Remove custom commit_on_success decorator

Prior to 1.3, django wouldn't set the transaction dirty upon a DB
exception and thus wouldn't trigger a rollback, resulting in a dangling
aborted DB exception. See https://code.djangoproject.com/ticket/9964...

6b256427 10/01/2013 06:56 pm Christos Stavrakakis

Request Django=>1.4, <1.5

Drop support for Django 1.2. Remove compatibility code that were used in
order to support Django 1.2 and 1.4. Finally update django documentation
link in the docs.

b694875c 10/01/2013 06:56 pm Christos Stavrakakis

wheezy: Rename depricated HttpRequest attribute

From django docs:
"""
HttpRequest.raw_post_data renamed to HttpRequest.body

This attribute was confusingly named HttpRequest.raw_post_data, but it
actually provided the body of the HTTP request. It’s been renamed to...

0a70d2c5 10/01/2013 06:16 pm Christos Stavrakakis

Merge branch 'hotfix-0.14.8' into develop

Merge hotfix-0.14.8 which ports Synnefo to wheezy and Django 1.4.5

Conflicts:
ci/ci_squeeze.conf
ci/ci_wheezy.conf
ci/schemas/one_node_squeeze/packages.conf
ci/schemas/one_node_squeeze/squeeze.conf
ci/schemas/one_node_squeeze/wheezy.conf...

b64a6cb5 09/30/2013 01:35 pm Sofia Papagiannaki

snf_django: Decode the mocked userid to a unicode object

8299ef23 09/27/2013 04:50 pm Christos Stavrakakis

Revert "wheezy: Rename depricated HttpRequest attribute"

This reverts commit cfc4b87c301504627e6a75ab2e4d32c8cd7a6e15. This
commit is reverted because it breaks compatibility with Django 1.2. This
should be applied for Synnefo 0.15.

cfc4b87c 09/27/2013 03:22 pm Christos Stavrakakis

wheezy: Rename depricated HttpRequest attribute

From django docs:
"""
HttpRequest.raw_post_data renamed to HttpRequest.body

This attribute was confusingly named HttpRequest.raw_post_data, but it
actually provided the body of the HTTP request. It’s been renamed to...

34bd6588 09/25/2013 12:39 am Christos Stavrakakis

wheezy: HttpResponse has no _is_string attribute

06014b1c 09/24/2013 05:16 pm Christos Stavrakakis

wheezy: fix _patch_resolve to comply with Django

Class RegexURLPattern doesn't contain `_get_callback' method any more
and resolve the callback when we try to retrieve it.

a6b17d33 09/24/2013 05:16 pm Christos Stavrakakis

wheezy: urls module doesn't export defaults

f82ed034 09/24/2013 05:16 pm Christos Stavrakakis

wheezy: Update Django dependency to <=1.4.5

0f66865f 09/24/2013 05:16 pm Ilias Tsitsimpis

wheezy: is_hop_by_hop has been removed from Django

Implement our own is_hop_by_hop function.

2c6ac437 09/24/2013 12:30 pm Christos Stavrakakis

Fix missing import and broken test

dcb8545f 09/24/2013 11:39 am Christos Stavrakakis

snf-django: Add missing import

3f9db536 09/24/2013 10:55 am Christos Stavrakakis

snf-django: pep8 fixes

7f59d209 09/23/2013 05:03 pm Christos Stavrakakis

snf-django: pep8 fixes

c9a2aff3 09/23/2013 01:39 pm Christos Stavrakakis

snf_django: Fix encoding in mocked userid

ed2064f8 09/18/2013 05:17 pm Christos Stavrakakis

Merge branch 'hotfix-0.14.6' into develop

Conflicts:
Changelog
docs/admin-guide.rst
snf-cyclades-app/synnefo/api/management/commands/network-remove.py
snf-cyclades-app/synnefo/api/servers.py
snf-cyclades-app/synnefo/api/tests/servers.py
snf-cyclades-app/synnefo/logic/backend.py...

f2080d16 09/17/2013 02:33 pm Christos Stavrakakis

cyclades: Mock vm removal if creation fails

In case creating a VM fails before the OP_INSTANCE_CREATE job is
enqueued in Ganeti, the VM and its NICs must be deleted, and the
resources must be released from Quotaholder, which is exactly what is
done when a VM is deleted from Ganeti. Instead of duplicating the code,...

39974c71 09/17/2013 01:55 pm Ilias Tsitsimpis

snf-django-lib: AssertionError in proxy

When we use proxy, we have to check that path starts with
the given proxy_base, and raise an AssertionError otherwise.

The check was there but it was wrong (there was missing
a not) and also no exception was raised.

981d3b0d 09/16/2013 05:39 pm Sofia Papagiannaki

pithos: Fix partial content responses

Refs: #4063

347b2ba1 09/12/2013 06:26 pm Giorgos Korfiatis

common: Strip trailing slash from endpoints

Remove trailing slash from the endpoints' publicURL field in service
definitions. These values end up in the response of POST /tokens, and,
according to the keystone API, should not end in slash. A trailing slash...

c1b7f449 09/10/2013 03:29 pm Christos Stavrakakis

Update objpool dependency to version 0.3

6ee6677e 08/08/2013 05:17 pm Sofia Papagiannaki

pithos: Add tests

d546637f 08/05/2013 04:06 pm Christos Stavrakakis

snf-django: PEP8 fixes

d758784b 08/05/2013 02:39 pm Christos Stavrakakis

Fix stale import statements

Commit 7cfc0ce moved code from webproject to snf_django. This commit
fixes some stale imports that skipped renaming.

7cfc0cef 08/05/2013 12:45 pm Christos Stavrakakis

snf-django: Move ListCommand to snf-django

snf-webproject contained the generic ListCommand, and because of this it
had a dependency from snf-django-lib. This commit moves this command from
snf-webproject to snf-django-lib and removes this dependency. Also,...

1a60832d 07/09/2013 05:10 pm Christos Stavrakakis

snf_django: Fix type error

4691814d 07/09/2013 04:30 pm Ilias Tsitsimpis

pep8 changes

32e4e343 07/07/2013 03:04 pm Christos Stavrakakis

PEP8 fixes

b6bc4afa 07/07/2013 03:04 pm Christos Stavrakakis

cyclades: Common filtering based on changes-since

Add 'filter_modified_since' function in snf_django api utils, for
parsing 'changes-since' HTTP parameter and filter the DB objects that
are updated after that date. Otherwise the deleted objects are returned.

3a19e99b 07/02/2013 04:56 pm Sofia Papagiannaki

pithos: update tests

f3787696 07/02/2013 04:23 pm Sofia Papagiannaki

pithos: WIP - rewrite pithos tests

41a7fae7 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Major refactor to api and logic apps

Major refactor to cyclades api and logic apps that removes most code
from the api views and moves it to logic app, so that the same logic
code can be used by different apps (e.g. EC2 API). Code is moved into...

f724142f 07/02/2013 12:31 pm Christos Stavrakakis

snf_django: Fix bug in BaseAPITest

Include 202 in success responses.

e5a47968 07/02/2013 12:31 pm Christos Stavrakakis

snf_django: Mock quotaholder to BaseAPITest

Mock quotaholder in all of BaseAPITest calls.

ce264c16 06/28/2013 09:27 pm Christos Stavrakakis

Merge branch 'hotfix-0.14.2' into develop

Conflicts:
snf-astakos-app/astakos/im/views/projects.py
snf-cyclades-app/synnefo/logic/backend.py
snf-django-lib/snf_django/lib/astakos.py
version

5e903a58 06/28/2013 09:15 pm Christos Stavrakakis

snf-django: Add retry option to AstakosClient

API method decorator should initialize the AstakosClient with the retry
argument set, in order to avoid errors caused by getting an old
connection from pool.

abe6915b 06/28/2013 09:12 pm Christos Stavrakakis

Merge branch 'release-0.14' into develop

Conflicts:
snf-astakos-app/astakos/im/views/target/redirect.py
snf-cyclades-app/synnefo/logic/backend.py
version

2ea2e173 06/28/2013 01:11 pm Stratos Psomadakis

Add proper logging for UserCache

15c05cb7 06/28/2013 11:05 am Stratos Psomadakis

Fix regressions in snf-manage list commands

c4b059b1 06/28/2013 09:47 am Stratos Psomadakis

Fix regressions in snf-manage list commands

584bdc72 06/26/2013 01:28 pm Sofia Papagiannaki

pithos: compatibility code for django greater than 1.2

Change condition for being compatible with django 1.2 or greater

4d244f4a 06/25/2013 08:20 pm Sofia Papagiannaki

pithos: Fix partial content responses

Refs: #4063

f089ffca 06/25/2013 03:24 pm Christos Stavrakakis

snf-django: Add retry option to AstakosClient

API method decorator should initialize the AstakosClient with the retry
argument set, in order to avoid errors caused by getting an old
connection from pool.

f9662798 06/19/2013 04:09 pm Kostas Papadimitriou

django-lib: Use requested default serialization

d0d9a3f5 06/18/2013 06:42 pm Kostas Papadimitriou

django-lib: api_method decorator improvements

allow API views to define supported serializations.

2ad4eb80 06/17/2013 01:35 pm Kostas Papadimitriou

django-lib: Additional BaseAPITest helper assertion

Introduce assertMethodNotAllowed method in BaseAPITest class. The method
asserts that provided response is a valid ``Method not allowed`` API response.

561803f6 06/13/2013 04:11 pm Georgios D. Tsoukalas

snf-django-lib: depend on python-objpool>=0.2

5f13452e 06/13/2013 03:15 pm Georgios D. Tsoukalas

snf-django-lib: depend on python-dateutil