snf-common: Suport 'Queue TTL' in AMQP clients

Extend the AMQP clients to support RabbitMQ's 'Queue TTL' extension, by
passing the 'x-expires' argument when declaring a queue. This argument
controls for how long a queue can be unused before it is automatically
deleted.
snf-common: Support 'no_ack' in AMQP clients

Enable the Synnefo AMQP clients to consume messages from the queues
without requiring acknowledgments.

Also, add the missing 'exclusive' argument in 'AMQPHaighaClient'.
gtools: Make the eventd send heartbeat messages

Make 'snf-ganeti-eventd' daemon to send heartbeat messages which can
be used to check that the daemon is working correctly, i.e. that it is watching
the Ganeti queue and that it can send messages to the AMQP broker. The
daemon is triggered to send a heartbeat message by setting a special tag
to the Ganeti cluster in 'dry-run' mode.

Heartbeat messages are send with the 'eventd.heartbeat' routing key.

Refs Issue #23
cyclades: Improve snf-dispatcher's help message

Add a description to snf-dispatcher's help message and improve the help
message of some options.
cyclades: Tool for checking Cyclades update path

Create a tool for checking the status of Cyclades update path, which
includes Ganeti, AMQP, snf-ganeti-eventd and snf-dispatcher. The tool is
created as part of the snf-dispatcher and can be used by passing the
'--status-check' option.

The tool sends a 'status-check' message to the running snf-dispatcher
process (via AMQP) and then waits to get the status report from an
exclusive queue. Respectively, the snf-dispatcher uses the Ganeti RAPI
client to add a special tag to each Ganeti cluster (in dry-run mode),
which will trigger snf-ganeti-eventd to send a heartbeat message to the
AMQP broker. Dispatcher collects all these message and sends the status
report back to the tool that triggered the status check.

Closes #23
Merge pull request #18 from cstavr/feature-dispatcher-check

Tool for checking status of Cyclades update path.

This patch series implements a tool for checking the status of Cyclades update path, which
includes Ganeti, AMQP, snf-ganeti-eventd and snf-dispatcher. The tool is
created as part of the snf-dispatcher and can be used by passing the
'--status-check' option. Also, snf-ganeti-eventd is extended in order to send
heartbeat messages.
cyclades: Unify arguments in management commands

Unify the string listing that is used to describe the arguments that are
accepted by snf-manage commands, and are displayed in the 'usage' of the
commands' help message. Also, add the argument in some commands that it
was missing.
Logging mechanism for Synnefo management commands

Design doc for the implementation of a logging mechanism for the
Synnefo's management commands.

Ref #3: Log all stdout/stderr for snf-manage invocations
Fix console output for management commands

From Django's documentation:
  When you are using management commands and wish to provide console
  output, you should write to self.stdout and self.stderr, instead of
  printing to stdout and stderr directly.

This patch fixes the managements commands to use the proper
stdout/stderr objects.

Ref #3: Log all stdout/stderr for snf-manage invocations
Use SynnefoCommand for django-admin commands

Instead of django's BaseCommand class, use out SynnefoCommand which
takes care of logging the command and its output.

Ref #3: Log all stdout/stderr for snf-manage invocations
Implement NewlineStreamHandler

When StreamHandler writes a formatted log message to its stream, it adds
a newline terminator. This behavior is inherited by FileHandler and the
other classes which derive from it (such as the rotating file handlers).

Starting with Python 3.2, the message terminator will be configurable.
This has been done by adding a terminator attribute to StreamHandler,
which when emitting an event now writes the formatted message to its
stream first, and then writes the terminator. If you don’t want newline
termination for a handler, just set the handler instance’s terminator
attribute to the empty string.

This class implements python's 3.2 StreamHandler.

Ref #3: Log all stdout/stderr for snf-manage invocations
snf-common: Add 'LOG_DIR' setting

'LOG_DIR' is the directory where log files are saved and is going to be
used to determine where to store the management commands' output.

Ref #3: Log all stdout/stderr for snf-manage invocations
Log Synnefo management commands to files

Create 'SynnefoOutputWrapper' which replaces Django's 'OutputWrapper'
and logs the command and its output in a file.

Ref #3: Log all stdout/stderr for snf-manage invocations