snf_django: Use 'replace' error strategy
Make custom CommandError use 'replace' strategy for unicodes that cannotbe decoded to user's preferred encoding.
snf_django: Fix csv unicode writer
Use recipe from http://docs.python.org/2/library/csv.html to write unicodein csv format.
snf_django: Handle unicode in CommandError
Define a custom CommandError, which applies smart_locale_str() in itsstr method.
snf_django: Fix alignment in pprint_table command
Alignment was broken from new code that decoded table fields usinguser's encoding, since len() function will count length of bytes and notcharacters. This commit fixes by making pprint_table work only with...
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. Insteadof recursively converting data, we convert the arguments to unicodes...
snf_django: Fix typo
snf_django: Revert wrong change in exclude list
Revert way that 'exclude' is called, from commit #99955a0.
cyclades: s/BaseCommand/SynnefoCommand
Replace use of BaseCommand with SynnefoCommand which will convert thearguments/options to unicode objects.
snf_django: Handle unicodes in SynnefoCommand
Extend SynnefoCommand to override 'run_from_argv' function in orderto decode command line argumuents and options, using the user'spreferred encoding.
snf_django: Add utils function to handle unicodes
Add utils functions to handle unicode objects from 'snf-manage' usingthe user's preferred encoding. Also add 'safe_string' function toescape control characters from strings and unicode objects.
Replace use of 'udec' with 'smart_unicode'
snf_django: Replace uenc with smart_unicode
snf_django: Explicitly set encoding of requests
Explicitly set request encoding to UTF-8 instead of relyingDEFAULT_CHARSET setting. See:https://docs.djangoproject.com/en/1.4/ref/unicode/#form-submission
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 amore represenative name for what the function is doing.
snf_django: Properly chain `exclude' queries
Although chained filters, e.g. filter(p1).filter(p2), can be summed up asfilter(p1, p2), this is not the case with exclude. If you want to excludethose selected by p1 as well as those selected by p2, you need...
snf_django: Fix select_related in ListCommand
Pass all related fields in a single call, because select_related does notchain as expected (yet). See https://code.djangoproject.com/ticket/16855
Also pass prefetch_related in a uniform way.
snf_django: Factor out resource reconcile
Generalize the checks operated during resource reconciliation so that theycan be used in all Synnefo components.
Adapt checks for user/project limits, include checks for project limits.
pithos: Add support for project originated quota
Introduce ``project`` container policy. The value of this policy denotesthe project from which the container quota originate.
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
cyclades: Detach serial from resource when resolved
snf_django: Fix bug in list commands
Fix bug in Synnefo ListCommand where you could not select to print onlythe user email columnd ('-o user.email').
astakos: Fix bug in Astakos stats view
'ASTAKOS_AUTH_URL' setting is not present in Astakos node.
django-lib: redirect option in proxy util
If set to True proxy view will return an http redirect response to thecorresponding target location.
Signed-off-by: Kostas Papadimitriou <kpap@grnet.gr>Signed-off-by: Ilias Tsitsimpis <iliastsi@grnet.gr>
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
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 ,thatparsed filters to querytset arguments, to 'parse_queryset_filters.The new function is currently unused.
cyclades: Optimize server-list command
Optimize server-list command by prefetching related fields if needed.
snf_django: Fix typo in --output-format help text
snf_django: Log all 5xx to 'django.request'
Change api_method decorator to log besides unhandled exceptions, all5xx API responses to 'django.request'.
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 defaultbehaviour to log unhandled exceptions as 'error' in 'django.request' andsent mail to admins for such cases.
snf_django: Propper logging of unexpected errors
Extend logging of unexpected errors, in 'api_method' decorator toinclude the request and the status code in the log record, in order tobe properly displayed by Django's AdminMailHandler.
django: Add a RemoveCommand class
cyclades: Update some snf-manage commands
cyclades: Verbal fixes on some snf-manage commands
Add a new function to assert success code 201
cyclades: Command to export Cyclades statistics
Add new 'snf-manage stats-cyclades' management command to export basicstatistics about Cyclades, like number of servers, network and resourceutilization. The command can either export the statistics either in JSON...
cyclades: Export Cyclades detailed stats from API
Add '/admin/stats/detail' API endpoint to export basic statistics aboutCyclades. Access to this view is only allowed to the users that belongto specific Astakos groups, as specified in the new setting'ADMIN_STATS_PERMITTED_GROUPS.' Also, added the new 'user_in_groups' API...
snf_django: Impose ordering on operator parsing
Turn the dict of operators to a list to make sure a certain ordering ispreserved.
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...
snf-django: Optimize DB queries in ListCommand
Add options to use 'prefetch_related' and 'select_related' options ofDjango queries to optimize the DB queries.
Fix pep8 errors
astakosclient: Usage request parameter deprecated
Astakos' Authenticate Api Method has deprecated the `usage' requestparameter. Remove it from AstakosClient.
astakosclient: Separate public/private POST /tokens
Introduce function authenticate(), which performs POST /tokens inprivate mode, i.e. giving a token to be checked for authentication.Function get_endpoints() performs the call in public mode, in orderto retrieve the endpoints....
astakos: Remove call GET /authenticate
Use POST /tokens to authenticate. Delete AstakosClient.get_user_info()and replace its uses by AstakosClient.authenticate().
django-lib: Use the new AstakosClient
cyclades: Fix output of network-inspect command
django-lib: Add assertConflict (409) in testing.py
cyclades: Fix the os-floating-ips API
Rewrite the of-floating-ips API to match with the new DB schema.
cyclades: Fix code for networks logic and API
cyclades: Fix and add new tests for /networks
Also, delete tests for old networks.
astakos: Remove custom ForUpdateManager
Remove custom manager that implemented select_for_update(), since thisis already implemented in Django 1.4.
astakos: Remove custom commit_on_success decorator
Prior to 1.3, django wouldn't set the transaction dirty upon a DBexception and thus wouldn't trigger a rollback, resulting in a danglingaborted DB exception. See https://code.djangoproject.com/ticket/9964...
Request Django=>1.4, <1.5
Drop support for Django 1.2. Remove compatibility code that were used inorder to support Django 1.2 and 1.4. Finally update django documentationlink in the docs.
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 itactually provided the body of the HTTP request. It’s been renamed to...
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...
snf_django: Decode the mocked userid to a unicode object
Revert "wheezy: Rename depricated HttpRequest attribute"
This reverts commit cfc4b87c301504627e6a75ab2e4d32c8cd7a6e15. Thiscommit is reverted because it breaks compatibility with Django 1.2. Thisshould be applied for Synnefo 0.15.
wheezy: HttpResponse has no _is_string attribute
wheezy: fix _patch_resolve to comply with Django
Class RegexURLPattern doesn't contain `_get_callback' method any moreand resolve the callback when we try to retrieve it.
wheezy: urls module doesn't export defaults
wheezy: Update Django dependency to <=1.4.5
wheezy: is_hop_by_hop has been removed from Django
Implement our own is_hop_by_hop function.
Fix missing import and broken test
snf-django: Add missing import
snf-django: pep8 fixes
snf_django: Fix encoding in mocked userid
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...
cyclades: Mock vm removal if creation fails
In case creating a VM fails before the OP_INSTANCE_CREATE job isenqueued in Ganeti, the VM and its NICs must be deleted, and theresources must be released from Quotaholder, which is exactly what isdone when a VM is deleted from Ganeti. Instead of duplicating the code,...
snf-django-lib: AssertionError in proxy
When we use proxy, we have to check that path starts withthe given proxy_base, and raise an AssertionError otherwise.
The check was there but it was wrong (there was missinga not) and also no exception was raised.
pithos: Fix partial content responses
Refs: #4063
common: Strip trailing slash from endpoints
Remove trailing slash from the endpoints' publicURL field in servicedefinitions. These values end up in the response of POST /tokens, and,according to the keystone API, should not end in slash. A trailing slash...
Update objpool dependency to version 0.3
pithos: Add tests
snf-django: PEP8 fixes
Fix stale import statements
Commit 7cfc0ce moved code from webproject to snf_django. This commitfixes some stale imports that skipped renaming.
snf-django: Move ListCommand to snf-django
snf-webproject contained the generic ListCommand, and because of this ithad a dependency from snf-django-lib. This commit moves this command fromsnf-webproject to snf-django-lib and removes this dependency. Also,...
snf_django: Fix type error
pep8 changes
PEP8 fixes
cyclades: Common filtering based on changes-since
Add 'filter_modified_since' function in snf_django api utils, forparsing 'changes-since' HTTP parameter and filter the DB objects thatare updated after that date. Otherwise the deleted objects are returned.
pithos: update tests
pithos: WIP - rewrite pithos tests
cyclades: Major refactor to api and logic apps
Major refactor to cyclades api and logic apps that removes most codefrom the api views and moves it to logic app, so that the same logiccode can be used by different apps (e.g. EC2 API). Code is moved into...
snf_django: Fix bug in BaseAPITest
Include 202 in success responses.
snf_django: Mock quotaholder to BaseAPITest
Mock quotaholder in all of BaseAPITest calls.
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
snf-django: Add retry option to AstakosClient
API method decorator should initialize the AstakosClient with the retryargument set, in order to avoid errors caused by getting an oldconnection from pool.
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
Add proper logging for UserCache
Fix regressions in snf-manage list commands
pithos: compatibility code for django greater than 1.2
Change condition for being compatible with django 1.2 or greater
django-lib: Use requested default serialization
django-lib: api_method decorator improvements
allow API views to define supported serializations.
django-lib: Additional BaseAPITest helper assertion
Introduce assertMethodNotAllowed method in BaseAPITest class. The methodasserts that provided response is a valid ``Method not allowed`` API response.
snf-django-lib: depend on python-objpool>=0.2
snf-django-lib: depend on python-dateutil