frontend/afe/models.py: improvements to check_for_acl_violation_hosts()

This introduces the following improvements:

 * Allow to check acl access violations for a user other than the
   current user (which is the default)
 * Print error message for all violations

Changes from v1:
 * Added documentation for username parameter
 * Identation fix to exception string

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend/afe/reservations.py: utilities for reserve/release

Simple utilities for managing reservations. The implementation is
based on setting and removing ACLs, that will prevent other users
from having access to machines that are reserved by others.

Changes from v1:
 * docstrings content and format
 * general style changes
 * created method to get default user

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend/afe/rpc_interface.py: add host reserve/release functions

This hooks the functionality in frontend/afe/reservations.py into
the RPC interface.

Changes from v1:
 * docstrings and style fixes

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
host reservations: add a java utility wrapper for reserving/releasing hosts

Changes from v1:
 * Style fixes

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
host reservations: UI changes for static reservations

added items to menu on host list page and wired to reservation calls
added buttons on host detail page and wired them to reservation calls
changed main html page to make it easier to dynamically add buttons on
view host page

Changes from v1:
  * whitespace cleanups

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
host reservations: added "Reserve Hosts" checkbox to create job page

Added checkbox and neccessary call parameters to pass it on to create job
rpc calls. Actual reservation is implemented on next patches.

Changes from v1:
 * bug fix for GUI clone
 * docstrings to sphinx format
 * whitespace cleanups

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
host reservations: added field representing if user requested reservation

Added the migration file generated by south automatically.

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
host reservations: implement reservation in scheduler

call reserve for hosts once they actually get going in
schedule_pre_job_tasks; this will work for hosts specified
by name and also metahosts

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
host reservations: added --reserve_hosts option to create job CLI

Also added unit tests and synch up rpc test text file.

Changes from v1:
 * multi-word command line arguments should use dashes

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
host reservations: changed scheduler models to use explicit field names

Previously scheduler was using select * style queries to fetch
objects from the database, that stopped working when south migration
changed the order of the tables. This change uses explicit field
names in select statements making more robust.

Changes from v1:
 * minor style changes and improved docstring

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
utils/test_importer.py: simple style fixes

Signed-off-by: Cleber Rosa <crosa@redhat.com>