Fix wrong expectation in hsqueeze shelltest

The shelltests expected the wrong position of the -f option
as well. Fix this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add Xen paused state as a Ganeti running state

The QA test 'TestClusterBurnin' pauses instances and the Xen state
domain 'paused' was not being handled properly by Ganeti because it
was not being classified as either a running or shutdown state.  This
patch adds the 'paused' state to the set of running states by
extending the function 'ganeti.hypervisor.hv_xen._IsInstanceRunning'
with the corresponding Xen state string '--p---'.

This fixes the QA test 'TestClusterBurnin'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Remove --enable-split-query option

Switching from python to haskell queries, this patch
removes the option to dis/enable the haskell queries
at configure time.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Use a query client for node queries where necessary

To remove the node query's python implementation soon, this
patch makes all users of the queries call the haskell
implementation instead of the python one.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Fix bug regarding node UUID in haskell node queries

When moving from python to haskell node queries, a bug
was discovered where a node's UUID was mistakenly
compared to a node's name. This indirectly caused the
cluster epo operation to fail, because it was not
able to identify the master node.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Implement 'QueryInstances' call in Haskell luxi server

While the command line uses the generic 'Query' call,
rapi calls 'QueryInstances'. 'QueryInstances' so far
was not fully implemented in the Haskell implementation
of the luxi server. This was discovered when trying to
switch from python to haskell queries. This patch
fixes the Haskell luxi server implementation wrt to that.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Move GetClient() to runtime module

Soon both, the cli and the masterd, will use a luxi
client to run queries. The method to obtain and configure
the luxi client with the right address can be reused from
cli to masterd here. Therefore, this patch moves the
function to the common runtime module.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Make watcher use query clients

So far, the watcher was still issuing node queries
via the python implementation. This patche switches to
the haskell implementation.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
masterd: implement query via luxi

The master daemon so far still did queries via the python
implementation. This patch implements that it uses the
haskell implementation and removes the node queries from
the list of OP-queriable entities.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Disable node query code

This patch removes the python query implementation for
nodes. So far, the code is replaced by 'NotImplemented'
exceptions, because the overall structure of query classes
can be removed more easily at once when all query
implementations are ready to be removed.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Switch to Haskell for network queries

This patch removes the python implementation of network
queries and replaces it with 'NotImplemented' exceptions.
It will be removed completely once all queries are
switched to Haskell.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Switch to haskell for export (aka backup) queries

This patch removes the python implementation of export
(aka backup) queries. So far, it is replaced by
'NotImplemented' exceptions, but later in this series
it will be replaced completely.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Use query client when neccessary for group queries

This patch makes code use the query client for group
queries where necessary in order to remove the python
queries soon.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Switch to Haskell for group queries

This patch removes the group query implementation
in python in order to use the new Haskell implementation.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
User query client necessary for instance queries

There were some places left when code querying for instance
information did not use the query client yet.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Adjust console behavior wrt to operation state

Unlike its cli counterpart, the rapi console operation did
not properly take into account whether the instance is
actually running. This patch fixes this problem.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Make watcher use queries properly

The watcher did not yet use the query client to make
queries. This patch fixes that.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Remove instance query python code

This patch removes the python code for the instance
queries. So far, it replaces it by 'NotImplemented'
exceptions. In a later patch of this series, the
remaining part is remove completely.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Remove op queries from masterd

Masterd still had some 'if' branches for the queries that
used to be op queries, but are now luxi queries. This
patch removes them.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Make burnin use luxi queries

Burnin was still using some op queries. With this patch,
they are now replaced by luxi queries.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>