astakos: Projects views enhancements

- Include total quota help text for each resource.
- Two column layout for per user/total quota.
- Fixed owner formatters in template filters.
- Proper display of unset project application resources.
- Hide base projects by default. Include base project toggling action in
  projects list view.
- Set proper project name field validators for base project in
  project modifcation form.
- Improve visual highlighting of quota diffs
- Improve membership status messages
- Improved project filtering in project list/join views
- List all public/active projects in `join project` view.
- Handle unowned projects in projects modification form
- Display all project resources in project application summary view.
- Permit zero values in project application/modification form.
- Avoid modifcation of immutable base project fields in project modification
  view.
- Display project/application creation date to project admins.
- Remove user base project when a user gets removed.
- Convert ProjectForbidden exception to 403 http responses.
- Additional user access checks handling in project/app detail view.
- Let both applicant and project admins to dismiss a denied project
  application.
- Forbid project owner to act upon an admin project modification.
- Prevent POST requests in project modification detail view.
- Handle pending app quota per applicant
  When applying for a modification, the existing pending modifications,
  which will be replaced, may have been initiated by another user. We need
  thus to handle the astakos.pending_app resource per applicant.
- Introduce `related`, `active` mode in projects list api call
  Related mode returns all projects user owns or is has a related
  membership to. Active mode returns available public/active projects.
ui: Project enhancements

- Use total resource quotas to identify available projects when vm is stopped.
- Handle ip addresses visibility when vm transitioning to error state.
- Improve vm entry highlighting when vm action is pending in icon view.
- Quota display styling improvements in project list items.
astakos: Projects views fixes

- Fix applicant permissions in project detail view.
- Restrict project owner email to be visible only by project admins.
- Fix access to unitialized project detail view.
- Alternative realname display for base projects.
- Do not require total members number in projects form. Set to infinite if
  no value is set to mimic api behaviour.
- Use application.owner instead of project.owner in the project listing view.
- Revert optional base project visibility in admin project list view.
- Display error when user is not allowed to call project action.
- Fix ordering of per member/total resources display.
- Remove "cancel" action in create/modify project summary view.
- Differentiate project modification heading (append "modification" suffix).
- Reword "base project" to "system project". "[system]" prefix with
  user email address and name is used to display base projects to admins.
- Hide details/membership sections in base project modificatation/details views.
pithos: Fix populating account usage info

A nested defaultdict is needed, because info is collected in a dict
structure of depth 3.
snf_django: Print title for a horizontal table

Enable adding a title above a horizontal table. It used to be possible
only for vertical tables.
astakos: Distinguish pending app in project-show

Use a table title to make it clear where the pending app starts.
astakos: Usage view improvements

- Display resource usage in project detail view.
- Remove overall usage bar.
- Use "System project" label for base projects.
- Display warning when project total usage is about to run out (>90%).
- Display links to project details view.
ui: Projects display improvements

- Handle resource project display if resource is associated to a project which
  the user is no longer a member to. In order to display project information
  ui makes an explicit project detail api call. In the case of vms, disable
  resize action if vm is assigned to such project.
- Improved IP auto-select/create logic in vm create wizard. By default select
  an ip assigned to the project selected in flavor step, if available. When
  user requests to create an IP address from the vm wizard view, the ui
  tries to assign the created IP object to the project selected in flavor step.
- Improved project display styling in vm wizard ip select step
- Truncate project name in vm wizard summary
- Display project name in flavor section in vm wizard summary
astakos: Update projects tests
Merge pull request #71 from vinilios/feature-projects-new

This patch series makes a number of project improvements, mainly in astakos ui, related to the updated projects api.
cyclades: Fix use of disk_template in stats

The 'disk_template' attribute has been moved from the 'Flavor' model to
the 'VolumeType' object. Update Cyclades statistics mechanism to reflect
this change.
astakos: Fix stats for new projects

The recent changes in the Astakos projects implementation changed the
contents of the 'quotaholder_app_holding' table. This table now contains
holdings for both users and projects. Also, the 'holder' column contains
user or project UUIDs, prefixed by 'user:' or 'project:' respectively.
This commit updates the stats mechanism in order to reflect the
aforementioned changes.
deploy: Add lock for status file

This is needed because some components are being installed
in parallel.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Use passwords found in conf files

The following passwords and secrets are needed for each deployment:

db, rapi, mq, vnc, cyclades, oa2, webproject, stats, and collectd.

Provide all of them in synnefo.conf file. Components can get them
via the config module e.g., config.synnefo_db_passwd,
config.cyclades_secret, etc.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Small changes in status module

Make check() and update() methods take a component as an argument
plus let the module decide whether to write the file to
permanent storage or not (it checks config.dry_run).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Fix status in case of parallel context

Fabric's @parallel creates separate processes in order to run the
requested tasks in parallel. Thus the CofigParser object held in memory
(status.cfg) is not the same across different processes.

To ensure validity, any read/update/write
operation must be done by using the status file in permanent storage
and not the status.cfg object.

For atomicity this must be done after acquiring the corresponding
lock. Introduce @_lock_read_write for this purpose.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Create random passwords if --pass-gen

In case --pass-gen option is used, snf-deploy instead of using
passwords found in conf files, it will create random passwords
and save them in status file under the section related to context's
setup (e.g. synnefo).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Modify conf files to include a qa setup

One could have three nodes with IPs 10.1.2.2-4, and run

snf-deploy ganeti-qa --setup qa

This will create a ganeti cluster (master.qa.synnefo.live) on
second and third node while the first one will be the development
node as well as the NFS and NS server.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Fix context issues in fabfile

Ensure that the context that each component is setup with, is
the correct one and does not include stale entries.

Use fabric's execute() method with hosts argument the proper
target nodes derived from current context. Introduce three
new decorators for this purpose:

 - with_ctx gets the current context
 - with_node updates the context's node with env.host
 - with_cluster updates the context's cluster with env.host

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
deploy: Extract ArchipSynnefo from Archip

Extract configuration settings related to gunicorn from the Archip
Component and put them in the new ArchipSynnefo Component that
is required only by Pithos and Cyclades.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>