ganeti-local
11 years agoMerge branch 'devel-2.7'
Iustin Pop [Tue, 5 Mar 2013 16:05:11 +0000 (17:05 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  Update required pylint version
  Constants.hs.in: improve Haddock markup in the template
  convert-constants: generate better Haddock markup
  Expand Haddock to run over test files as well

Conflicts:
        Makefile.am (curl changes and new hs directories)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoUpdate required pylint version
Iustin Pop [Tue, 5 Mar 2013 15:00:50 +0000 (16:00 +0100)]
Update required pylint version

This should help a lot of users, since pylint 0.21.1 was quite an old
version…

The tree is "clean" w.r.t. the new pylint version.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoConstants.hs.in: improve Haddock markup in the template
Iustin Pop [Tue, 5 Mar 2013 13:12:42 +0000 (14:12 +0100)]
Constants.hs.in: improve Haddock markup in the template

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoconvert-constants: generate better Haddock markup
Iustin Pop [Tue, 5 Mar 2013 13:11:24 +0000 (14:11 +0100)]
convert-constants: generate better Haddock markup

Currently the Python source constants are used as-is, which is not
nice on the eyes (especially for unqualified names, it was hard to
separate them visually).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoExpand Haddock to run over test files as well
Iustin Pop [Tue, 5 Mar 2013 13:07:50 +0000 (14:07 +0100)]
Expand Haddock to run over test files as well

This patch does multiple enhancements to the way we build the Haddock
docs, motivated by the fact that if we don't run Haddock over test
files as well, bad formatting can be submitted and will accumulate
over time (without any checks).

The patch does:

- replace manual built ALL_APIDOC_HS_DIRS with automatically built one
  (from HS_DIRS)
- change Haddock so that it runs from the top directory (instead of
  from src/)
- change HsColour target file to be built via bash parameter
  substitution, rather than sed (I don't know how to do it in one go,
  so I use 2 intermediate variables)
- change 'hs-apidoc' target so that it depends on the real target
  file; in case no source file has been modified, running 'make
  hs-apidoc' twice will not result in two runs
- run HsColour/Haddock under en_US.UTF-8 locale, otherwise they can't
  parse correctly the Unicode chars in the test files

Additionally, wrong formatting (oops) in a test file has been
corrected.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoMerge branch 'devel-2.7'
Iustin Pop [Tue, 5 Mar 2013 09:21:15 +0000 (10:21 +0100)]
Merge branch 'devel-2.7'

* devel-2.7: (23 commits)
  Add export lists for files which didn't have them
  Fix Haskell compatibility tests with disabled file storage
  Fix QA with disabled file storage
  Fix convert-constants handling of booleans
  Fix handling of disabled (shared) file storage
  Fix low verbosity levels in htools
  Fix improperly formatted docstring
  Allow iallocator to work without LVM storage
  Allow rpc.MakeLegacyNodeInfo to parse non-LVM results
  Fix LUTestAllocator with instance alloc
  Fix confd issue regarding --no-lvm-storage
  Fix networks in _PrepareNicModifications()
  Fix sphinx label namespace
  Clarify use of move-instance with self-signed certificates
  Remove early returns in network LUs
  Fix HooksDict() in case of no tags
  Add networks to _AllIDs()
  Fix locking in LUNetworkConnect()
  Fix networks in LUInstanceSetParams()
  Fix another docstring typo
  ...

Conflicts:
        src/Ganeti/Query/Node.hs (trivial; function rename in master
                                  and 'vgs' change in devel-2.7)
        also exported new entity from TestCommon.hs (used in master)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoSwitch LispConfig double comparison to relative error
Iustin Pop [Thu, 28 Feb 2013 13:34:28 +0000 (14:34 +0100)]
Switch LispConfig double comparison to relative error

This further improves the comparison for "non-trivial"
numbers. Without this patch, there are still cases where the absolute
error is too big, and we need to switch to relative error.

Concept has been taken from
<http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/>.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoSwitch Attoparsec parser from double to rational
Iustin Pop [Thu, 28 Feb 2013 10:05:45 +0000 (11:05 +0100)]
Switch Attoparsec parser from double to rational

According to the documentation, “This function is almost ten times
faster than rational, but is slightly less accurate. For 94.2% of
numbers, this function and rational give identical results, but for
the remaining 5.8%, this function loses precision around the 15th
decimal place. For 0.001% of numbers, this function will lose
precision at the 13th or 14th decimal place.”. What happens is that
for our tests, it can happen that “Attoparsec.double (show a_double)”
is quite different from “a_double”, such that we have much more than
1e-12 absolute difference.

Since our xm lists should not be too big, I think switching to
rational is better. Next patch also changes the way we compare
doubles, so maybe this patch is not really needed…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoMake the XmParser config test runtime more consistent
Iustin Pop [Thu, 28 Feb 2013 10:31:35 +0000 (11:31 +0100)]
Make the XmParser config test runtime more consistent

Currently, the test uses a frequency of 5 string/5 double/1 list for
generating Arbitrary instances of ListConfig. However, the list case
has simply a "choose (1, 20)" `vectorOf` arbitrary, which means it
could recurse forever.

Manually running only this test gives runtime as such:

- ~100-200ms: very often
- ~1-2s: often
- ~5s: rare
- ~20s: very rare (but I hit this when running < 30 times the test,
  so…)

On average, this makes this test one of the slowest ones, which is
annoying.

By changing to a sized generator, we can control the depth of the
recursion, ensuring that we have a consistent runtime: out of 100
runs, one is 229ms, one is 164ms, the other are 80-120ms.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImprove output of the XmParser config test
Iustin Pop [Thu, 28 Feb 2013 10:00:52 +0000 (11:00 +0100)]
Improve output of the XmParser config test

Currently, this tests and its helper function 'isAlmostEqual' uses
plain booleans to signify failures, which means you can't really debug
a failed test. The patch changes the call chain to use annotated
properties all through, which results in messages like:

  Failing almost equal check
  Delta 3.725290298461914e-9 not smaller than 1e-12
  expected: 2.147785408767952e7
   but got: 2.1477854087679517e7

which (IMHO) it's much more readable.

The patch also replaces a 'fail' with 'failTest' in another test.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix node partial name matching in Haskell code
Iustin Pop [Wed, 27 Feb 2013 16:50:40 +0000 (17:50 +0100)]
Fix node partial name matching in Haskell code

This implements QffHostname and fixes the node listing (as well as
export listing when filtering on node name).

This bug was hidden by the fact that node listing with "gnt-node list
aa" works if you don't have live queries (as it was originally), as
the choosing of wanted nodes out of the config based on short names
works. What didn't work was later post-filtering based on such short
names (kind of duplicate, but that's how the code path is).

By implementing QffHostname, we can have custom equality checks, like
in the Python code. What I don't like is how convoluted the testing on
various left/right combinations is, but I didn't find an easier way.

The included unittest tests the partial filtering behaviour, and fails
if the node name flag is not set to QffHostname.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix bug in group queries related to node/instance fields
Iustin Pop [Mon, 25 Feb 2013 16:18:36 +0000 (17:18 +0100)]
Fix bug in group queries related to node/instance fields

Since we use the primitive string type for group UUIDs, the group
fields have a bug where we pass the group name as filter for node
tests, whereas the nodes themselves use the group UUID. This results
in zero node count, empty node list, and no instances being reported
as assigned to groups.

The patch fixes this and adds a test for the node count. It does some
test generation improvement, and also cleans up whitespace issues in
Test/G/Q/Query.hs (the functions case_queryNode_allfields,
prop_queryGroup_noUnknown and case_queryGroup_allfields are unchanged
but simply have indentation fixed).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAbstract the individual query functions
Iustin Pop [Mon, 25 Feb 2013 12:59:01 +0000 (13:59 +0100)]
Abstract the individual query functions

After implementing a few of the query executor functions, it turns out
that we have the same general pattern:

- compile the filter
- extract the selected fields
- determine whether we need to run collectors
- do a first pass filtering
- run the collector if needed
- compute the final fields

For pure config queries, the collector/final computation is not
needed, but otherwise the code flow is the same.

We can therefore abstract all the queries that originate in the config
(i.e. except the job query) and have a single code path for all of
them, just with different parameters.

To do this, we add some stub collectors for group/network queries,
which don't have live data.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAllow confd to serve network list-fields queries
Iustin Pop [Fri, 22 Feb 2013 15:01:04 +0000 (16:01 +0100)]
Allow confd to serve network list-fields queries

The fields are not yet complete, but at least we can enable the
list-field query to see what is there already.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRename/make uniform the other query entities
Iustin Pop [Fri, 22 Feb 2013 13:59:31 +0000 (14:59 +0100)]
Rename/make uniform the other query entities

Following the new naming style introduced in Exports.hs, this patch
renames the other resources to export non-qualified names (fieldMap as
opposed to nodeFieldMap), and to use qualified module imports.

Also fixes a haddock issue in a docstring.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd export lists for files which didn't have them
Iustin Pop [Mon, 4 Mar 2013 15:39:00 +0000 (16:39 +0100)]
Add export lists for files which didn't have them

Two test helper files didn't have export lists (lost during the split
of tests). This patch finally reintroduces them, to hopefully make the
export list saner and with fewer changes for purely-internal changes.

Additionally, a few missing docstrings are added as well.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix Haskell compatibility tests with disabled file storage
Iustin Pop [Mon, 4 Mar 2013 12:32:22 +0000 (13:32 +0100)]
Fix Haskell compatibility tests with disabled file storage

When file storage is disabled at ./configure time, we shouldn't pass
opcodes containing DTFile/DTSharedFile/StorageFile to Python for
validation, as they will fail.

This patch implements this by simply tweaking the Arbitrary instances
for DiskTemplate and StorageType (which IMHO is a nice and clean
way!), and also fixing the generation of arbitrary IPolicies to use
the correct 'allDiskTemplates' list (otherwise we'd loop forever
trying to generate a list of all templates).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix QA with disabled file storage
Iustin Pop [Mon, 4 Mar 2013 12:07:25 +0000 (13:07 +0100)]
Fix QA with disabled file storage

Currently QA tries to use “gnt-node list-storage” with all storage
types, but when file storage is disabled this will fail.

The patch changes it so that if file storage is disabled, we test that
indeed fails, and otherwise we include it in the regular tests.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix convert-constants handling of booleans
Iustin Pop [Mon, 4 Mar 2013 10:54:06 +0000 (11:54 +0100)]
Fix convert-constants handling of booleans

It turns out that, in Python, booleans are also integers. So they fall
under the “isinstance(value, int)” case, resulting in all enable*
constants being integers in Haskell, which is not nice, even though
we're not using them directly today.

Patch simply adds a special casing for booleans, before integers.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix handling of disabled (shared) file storage
Iustin Pop [Mon, 4 Mar 2013 10:44:10 +0000 (11:44 +0100)]
Fix handling of disabled (shared) file storage

The vcluster changes broke the disabling of file storage; we can
workaround by (manually) skipping the virtualisation of file storage
paths if they are not enabled.

Note that tests/QA are still broken with disabled file storage; this
patch only fixes production code.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix low verbosity levels in htools
Iustin Pop [Mon, 4 Mar 2013 10:24:51 +0000 (11:24 +0100)]
Fix low verbosity levels in htools

In a few cases, we tested the verbosity level for (== 0), instead of
higher/lower than a certain value. If the user passes multiple
"--quiet" options, this can result in negative verbosity levels, which
behave like "extra verbosity".

Sigh for plain data types as opposed to proper verbosity levels…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix improperly formatted docstring
Michele Tartara [Wed, 6 Feb 2013 09:16:01 +0000 (09:16 +0000)]
Fix improperly formatted docstring

Change the docstring of chompPrefix to prevent the error
"doc comment parse failed" that was raised by some version of
haddock while generating the documentation for this function.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
(cherry picked from commit 94042ae4f2f6983a04d1ff2c99144330562b6301)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoAllow iallocator to work without LVM storage
Iustin Pop [Fri, 1 Mar 2013 11:45:38 +0000 (12:45 +0100)]
Allow iallocator to work without LVM storage

Currently, the iallocator interface requires LVM storage, due to the
way it computes the node storage information.

By changing the code to understand that GetVGName() can return None,
and by setting the disk_total/disk_free node parameters to the value
zero, we can workaround this issue until proper multi-storage
reporting is implemented.

The hail iallocator plugin works without changes once this is
implemented, as it already handles non-LVM storage as "foreign"
storage (with unlimited capacity).

The patch also changes a bit how the parameters are retrieved and
used; hopefully this is a bit safer and more readable.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAllow rpc.MakeLegacyNodeInfo to parse non-LVM results
Iustin Pop [Fri, 1 Mar 2013 11:23:23 +0000 (12:23 +0100)]
Allow rpc.MakeLegacyNodeInfo to parse non-LVM results

'MakeLegacyNodeInfo' is not the best place for this, but we'd have to
duplicate it if we wanted a LVM-less version, so the easiest is to add
an optional parameter that allows it to accept/skip LVM-less results.

It still requires at most one VG result, so its behaviour isn't
changed in this respect.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix LUTestAllocator with instance alloc
Iustin Pop [Fri, 1 Mar 2013 09:59:55 +0000 (10:59 +0100)]
Fix LUTestAllocator with instance alloc

This is similar to commit 8775e62a; the addition of node_whitelist
broke this LU as well.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoFix confd issue regarding --no-lvm-storage
Dimitris Aragiorgis [Thu, 28 Feb 2013 01:29:33 +0000 (03:29 +0200)]
Fix confd issue regarding --no-lvm-storage

If cluster is initialized with --no-lvm-storage then volume_group_name
does not exist in config.data. Thus we must define it as optional in
confd.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: fixed Haskell RPC definition]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoFix networks in _PrepareNicModifications()
Dimitris Aragiorgis [Tue, 26 Feb 2013 20:28:42 +0000 (22:28 +0200)]
Fix networks in _PrepareNicModifications()

Passing --net 0:add,ip=5.5.5.5 failed due to a reference
of a non initialized variable (new_net_obj). Reorder the checks
and add some comments to be readable.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix sphinx label namespace
Iustin Pop [Thu, 28 Feb 2013 16:40:39 +0000 (17:40 +0100)]
Fix sphinx label namespace

Thanks Michael for pointing out the error!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoClarify use of move-instance with self-signed certificates
Iustin Pop [Thu, 28 Feb 2013 15:32:11 +0000 (16:32 +0100)]
Clarify use of move-instance with self-signed certificates

The document doesn't mention which certificates need to be passed as
ca-file, so let's try to clarify that.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Support diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 14:51:36 +0000 (15:51 +0100)]
QA: Support diskless instances

This is an initial implementation of diskless instances.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Compare ipolicy directly with None
Michael Hanselmann [Wed, 27 Feb 2013 15:18:05 +0000 (16:18 +0100)]
QA: Compare ipolicy directly with None

If a value was set to numeric 0, the parameter wouldn't be passed to the
command.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: List all ipolicy options in example configuration
Michael Hanselmann [Wed, 27 Feb 2013 15:10:08 +0000 (16:10 +0100)]
QA: List all ipolicy options in example configuration

This makes it easier to know what options are available.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Update assertion for diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 16:45:04 +0000 (17:45 +0100)]
QA: Update assertion for diskless instances

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Disable reinstall test for diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 15:57:44 +0000 (16:57 +0100)]
QA: Disable reinstall test for diskless instances

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Fix dictionary formatting
Michael Hanselmann [Wed, 27 Feb 2013 14:48:46 +0000 (15:48 +0100)]
QA: Fix dictionary formatting

Make it match the style guide.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Disable drbd-offline test if no DRBD instance is used
Michael Hanselmann [Wed, 27 Feb 2013 14:46:43 +0000 (15:46 +0100)]
QA: Disable drbd-offline test if no DRBD instance is used

If “instance-add-drbd-disk” is not enabled it usually also means to not
use DRBD at all.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoRemove early returns in network LUs
Dimitris Aragiorgis [Thu, 28 Feb 2013 13:55:03 +0000 (15:55 +0200)]
Remove early returns in network LUs

Remove any early returns in LUNetworkDisconnect/LUNetworkConnect
and replace them with if-else statements.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoTest AsyncStreamServer with abstract unix sockets
Guido Trotter [Tue, 19 Feb 2013 22:41:19 +0000 (14:41 -0800)]
Test AsyncStreamServer with abstract unix sockets

This was meant to be since "the beginning" but was never submitted as
somehow it failed with python 2.4. Now that the minimum python version
has been increased it can be added.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Disable RAPI tests for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 14:32:29 +0000 (15:32 +0100)]
QA: Disable RAPI tests for virtual clusters

The QA script connects to the RAPI daemon. In virtual cluster setups the
daemon is usually listening on a local interface not reachable from the
outside.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Add virtual cluster support to queue drain test
Michael Hanselmann [Thu, 21 Feb 2013 15:27:22 +0000 (16:27 +0100)]
QA: Add virtual cluster support to queue drain test

The path to the queue drain file must use the virtual node path.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Disable copyfile test for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 15:27:01 +0000 (16:27 +0100)]
QA: Disable copyfile test for virtual clusters

This test will need some more work for virtual clusters. Disable it in
the meantime.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Disable OOB tests for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 15:26:31 +0000 (16:26 +0100)]
QA: Disable OOB tests for virtual clusters

They do not work properly at the moment.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Update virtual node's RAPI users file
Michael Hanselmann [Thu, 21 Feb 2013 14:33:45 +0000 (15:33 +0100)]
QA: Update virtual node's RAPI users file

The file is located below the virtual node directory.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Read virtual node's RAPI certificate
Michael Hanselmann [Thu, 21 Feb 2013 14:32:51 +0000 (15:32 +0100)]
QA: Read virtual node's RAPI certificate

The virtual node prefix must be added to the path.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_os: Disable checks for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 14:17:44 +0000 (15:17 +0100)]
qa_os: Disable checks for virtual clusters

The OS definitions are not virtualized. Tests configuring different OS
definitions on different nodes don't work properly.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_instance: Virtual cluster support for instance list
Michael Hanselmann [Thu, 21 Feb 2013 14:15:34 +0000 (15:15 +0100)]
qa_instance: Virtual cluster support for instance list

Use path of virtual node when retrieving ssconf's instance list.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_daemon: Virtual cluster support
Michael Hanselmann [Thu, 21 Feb 2013 14:14:19 +0000 (15:14 +0100)]
qa_daemon: Virtual cluster support

Use virtual node path when removing the watcher status file.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_utils: Support virtual cluster for backup files
Michael Hanselmann [Thu, 21 Feb 2013 13:58:27 +0000 (14:58 +0100)]
qa_utils: Support virtual cluster for backup files

“qa_utils.BackupFile” is always called with the path for a normal node.
In virtual clusters the node prefix path must be added.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_utils: Virtual cluster support for SSH commands
Michael Hanselmann [Thu, 21 Feb 2013 14:10:59 +0000 (15:10 +0100)]
qa_utils: Virtual cluster support for SSH commands

In virtual clusters, all “gnt-*” and “ganeti-*” commands require
environment variables to be set for the virtual cluster root directory
and node name. The “cmd” script generated by “vcluster-setup” is a
wrapper setting those variables.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_config: Support callable test checks
Michael Hanselmann [Thu, 21 Feb 2013 13:54:54 +0000 (14:54 +0100)]
qa_config: Support callable test checks

Until now all tests depended on simple AND/OR conditions. With the
introduction of virtual cluster support, some tests can only run if
virtual clusters are not in use (e.g. not yet supported or not
possible). Instead of introducing more logic for enabling/disabling
tests, callable values are supported instead. “ht.WithDesc” should be
used on them to continue to provide a readable description.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Add config entries for virtual cluster
Michael Hanselmann [Fri, 8 Feb 2013 16:36:57 +0000 (17:36 +0100)]
QA: Add config entries for virtual cluster

If these new options are set, a virtual cluster is created and used.
Virtual clusters consist of 1..N virtual nodes on a single physical (or
virtual) node. The design of virtual clusters is described in
“doc/design-virtual-clusters.rst”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoFix typo in docstring
Christos Stavrakakis [Tue, 26 Feb 2013 16:49:18 +0000 (18:49 +0200)]
Fix typo in docstring

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agorapi.rst: Replace manual method lists with directive
Michael Hanselmann [Fri, 22 Feb 2013 14:19:12 +0000 (15:19 +0100)]
rapi.rst: Replace manual method lists with directive

Many resources, but not all, list their supported methods. With a new
reST directive, this list is now automatically generated and also lists
the required permissions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix HooksDict() in case of no tags
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:28 +0000 (03:39 +0200)]
Fix HooksDict() in case of no tags

In this method self.tags might be None and cannot be used
in join(). Use GetTags instead.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd networks to _AllIDs()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:27 +0000 (03:39 +0200)]
Add networks to _AllIDs()

networks config objects have UUIDs and thus should be included
in _AllUUIDObjects().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix locking in LUNetworkConnect()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:26 +0000 (03:39 +0200)]
Fix locking in LUNetworkConnect()

Locks for group instances are aquired only if conflicts are checked.
To this end we must _CheckNodeGroupInstances() only then otherwise
this check will always fail (owned_instances will be []).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix networks in LUInstanceSetParams()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:25 +0000 (03:39 +0200)]
Fix networks in LUInstanceSetParams()

Params passed in _CreateNewNic() are not yet evaluated and include
the value passed by user for the network. A lookup must be done first
in order to find the corresponding network UUID which should be stored
in the newly created NIC object.

Params passed in _ApplyNicMods() include the value passed by user
for the network. Thus a lookup must be done first in order to find
the corresponding network UUID. Then compare it with the existing
value and act accordingly.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoHRoller: allow filtering by node group
Guido Trotter [Thu, 21 Feb 2013 21:40:14 +0000 (13:40 -0800)]
HRoller: allow filtering by node group

Accept the -G option, and if it's passed require that it matches a
nodegroup, then only output nodes belonging to that group.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoHRoller: print only online nodes
Guido Trotter [Thu, 21 Feb 2013 21:37:41 +0000 (13:37 -0800)]
HRoller: print only online nodes

To make the graphs work even when instances live on offline nodes (eg.
because we're offlining them just to exclude them, or because they have
instance still on them) we just filter them out at the end, when we're
going to print out the result.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoOfficially require Python 2.6+
Guido Trotter [Thu, 21 Feb 2013 17:50:55 +0000 (09:50 -0800)]
Officially require Python 2.6+

We have no way to test Python 2.4 compatibility anymore, and that
version is long deprecated. From version 2.8+ require Python 2.6 or
above (but still not 3.0).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agobootstrap: Wait for SSH daemon to become reachable
Michael Hanselmann [Thu, 21 Feb 2013 17:45:42 +0000 (18:45 +0100)]
bootstrap: Wait for SSH daemon to become reachable

In some situations after restarting the SSH daemon by
“prepare-node-join” it's not immediately reachable. Like with the master
and node daemons, waiting for it to become reachable instead of failing
hard can help in such situations.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoTcpPing: Better error handling, logging
Michael Hanselmann [Thu, 21 Feb 2013 17:44:35 +0000 (18:44 +0100)]
TcpPing: Better error handling, logging

Log every attempt to reach a port on another node. Don't silently return
False if a target not recognized as an IP address is given (e.g. a
hostname).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoWipe disks added through "gnt-instance modify"
Michael Hanselmann [Mon, 25 Feb 2013 15:27:27 +0000 (16:27 +0100)]
Wipe disks added through "gnt-instance modify"

In issue 353 Sascha Lucas reported that disks are not wiped when added
through “gnt-instance modify”. This patch adds this functionality and
updates the docstring for “_WipeDisks”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agovcluster-setup: Create $vnode/etc/ganeti directory
Michael Hanselmann [Thu, 21 Feb 2013 15:47:23 +0000 (16:47 +0100)]
vcluster-setup: Create $vnode/etc/ganeti directory

This directory is required by “cfgupgrade” and some other tools.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoconstants: Use SSH constant for daemon ports
Michael Hanselmann [Thu, 21 Feb 2013 17:43:28 +0000 (18:43 +0100)]
constants: Use SSH constant for daemon ports

Moving the SSH/SCP constants around was necessary for this.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix style violations in commit 4a90bd4, small changes
Michael Hanselmann [Fri, 22 Feb 2013 15:50:41 +0000 (16:50 +0100)]
Fix style violations in commit 4a90bd4, small changes

- Commit 4a90bd4 contained a rather large number of style violations:
  - Indentation/sequence formatting
  - Wrapping of long lines
  - Docstrings whose first line was wrapped
  - A stray backslash in a docstring
- opcodes: Don't check for list or tuple. None of the other opcodes does
  it explicitely. As long as the length and the items match the value is
  accepted.
- server/noded: “if variable” doesn't test for None, but False

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: New directive for supported methods
Michael Hanselmann [Fri, 22 Feb 2013 14:18:56 +0000 (15:18 +0100)]
sphinx_ext: New directive for supported methods

Until now many resources, but not all and not consistently list their
supported methods (e.g. “Supports the following commands: ``GET`` …”).
Not only is it easy for this list to get out of date, but it would also
be nice if it listed the required access permissions.

This patch adds a new directive to insert a table listing all supported
methods and their access permissions for a resource.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: Factorize getting RAPI handlers
Michael Hanselmann [Fri, 22 Feb 2013 14:17:17 +0000 (15:17 +0100)]
sphinx_ext: Factorize getting RAPI handlers

The list of resources and handlers will also be used for generating
a per-resource table.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: Factorize handler methods/access
Michael Hanselmann [Fri, 22 Feb 2013 14:12:50 +0000 (15:12 +0100)]
sphinx_ext: Factorize handler methods/access

The factorized parts will be used to show a small table with methods and
required permissions for each resource.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUse "none" instead of "everyone" in RAPI documentation
Michael Hanselmann [Fri, 22 Feb 2013 14:07:08 +0000 (15:07 +0100)]
Use "none" instead of "everyone" in RAPI documentation

The list of required access permissions uses the word “everyone” to mean
“no special permissions are needed”. The word “none” fits better.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years ago.gitignore: Add test/hs/harep
Michael Hanselmann [Fri, 22 Feb 2013 15:57:51 +0000 (16:57 +0100)]
.gitignore: Add test/hs/harep

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dato Simó <dato@google.com>

11 years agoRewrap a comment in constants.py
Iustin Pop [Mon, 25 Feb 2013 08:40:42 +0000 (09:40 +0100)]
Rewrap a comment in constants.py

As it was 80 chars, and you know that bothers me :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoEnable split queries for export in CLI
Iustin Pop [Fri, 22 Feb 2013 12:18:45 +0000 (13:18 +0100)]
Enable split queries for export in CLI

Rapi doesn't seem to export backup lists, so we enable the split query
only in gnt-backup.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoImprove the rpc-test program
Iustin Pop [Fri, 22 Feb 2013 11:25:18 +0000 (11:25 +0000)]
Improve the rpc-test program

This is an ugly patch, sorry. It adds the following features to
rpc-test, to help with (stress) testing the Haskell RPC client:

- customisable repeat count for the RPCs
- customisable parallelisation factor
- options to show timing stats and other information
- capability to execute any RPCs already defined, as opposed to having
  the RPC hardcoded; this requires a data file (defaulting to
  "rpc.json") that has the serialised RPC call

The polymorphism/way the RPC library is implemented requires us to
have some duplicate code (operating on different types); I wasn't able
to found a way to make this more abstract.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImplement Export queries in Haskell
Iustin Pop [Thu, 21 Feb 2013 16:52:15 +0000 (17:52 +0100)]
Implement Export queries in Haskell

This is a simple query as it has only two fields, however it's the
first query that doesn't have a clear 'base' object and 1:1
correspondence between such objects and the results (groups, nodes and
networks do so).

We keep nodes as the 'base' object, since that's what we want to
filter on for RPC selection, and we have a very simple type as the
runtime type, since we only have one other field. The
'collectLiveData' function is the one that does the expansion from
[node] to [(node, path)], with the help of 'rpcExtractor'.

Also, this patch introduces a slightly different naming structure for
the exported names out of the module, to reduce naming conflicts.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix exports query with failed RPCs
Iustin Pop [Thu, 21 Feb 2013 16:41:34 +0000 (17:41 +0100)]
Fix exports query with failed RPCs

When the RPC to a node has failed (for whatever reason), we currently
return _FS_UNAVAIL, which means "this node doesn't support
exports". However, that is misleading: all nodes support exports, but
we failed to list them at the moment, so _FS_NODATA (temporary
failure) is more appropriate here.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoAdd export_list RPC call definitions
Iustin Pop [Thu, 21 Feb 2013 13:54:19 +0000 (14:54 +0100)]
Add export_list RPC call definitions

This is straightforward, as the call has no parameters and a very simple return type.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImprove TemplateHaskell code to support empty objects
Iustin Pop [Thu, 21 Feb 2013 13:52:07 +0000 (14:52 +0100)]
Improve TemplateHaskell code to support empty objects

Currently, an empty objects will generate warnings as the arguments of
various functions are unused. By adding conditional code for this, we
can support generation of empty objects, e.g. like needed in Rpc code.

Additionally, the patch also converts RpcCallVersion to THH, now that
it can build it. We change the serialisation for this (from JSNull to
JSObject []), but this shouldn't matter as this is not used in
production.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix Curl/Internal.hs not being in gitignore
Iustin Pop [Thu, 21 Feb 2013 16:38:27 +0000 (17:38 +0100)]
Fix Curl/Internal.hs not being in gitignore

This is an autogenerated file, so it has to go into gitignore, thanks
Michael!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd option to redirect luxi socket for debugging
Iustin Pop [Thu, 21 Feb 2013 12:51:03 +0000 (13:51 +0100)]
Add option to redirect luxi socket for debugging

Currently, the choice between masterd and conf/queryd is made
statically, based on whether a query is converted or not and whether
split queries are enabled. This makes it hard to test and develop
these new queries, so this patch adds an override for the socket.

The choice for going with two hardcoded strings and arbitrary socket
fallback is done so that it's easy to use this in virtual clusters as
well.

Additionally, the patch improves the error message on failed connects
when we use arbitrary sockets; before, it always "blamed" confd for
non-master sockets.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoFix another docstring typo
Iustin Pop [Thu, 21 Feb 2013 14:10:56 +0000 (15:10 +0100)]
Fix another docstring typo

… no comment :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoImprove RAPI documentation on users and options
Michael Hanselmann [Thu, 21 Feb 2013 10:48:59 +0000 (11:48 +0100)]
Improve RAPI documentation on users and options

- Document fields in “rapi/users” file in the order they appear
  (username, password, options)
- Mention new “--require-authentication” option
- Clarify use of “write” on “GET” method

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agosphinx_ext: Drop text map for RAPI permissions
Michael Hanselmann [Thu, 21 Feb 2013 10:47:39 +0000 (11:47 +0100)]
sphinx_ext: Drop text map for RAPI permissions

Other parts of the documentation directly refer to the constants through
“pyeval”. There's no need for this map as it's just additional work to
maintain.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoRAPI: Add flag to require authentication
Michael Hanselmann [Wed, 20 Feb 2013 17:01:56 +0000 (18:01 +0100)]
RAPI: Add flag to require authentication

Most RAPI resources do not require authentication for the “GET” method.
In some setups it can be desirable to always require authentication.
This patch adds a command line parameter to always require it.

Some unrelated minor typos in the “ganeti-rapi” man page are also fixed.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Thu, 21 Feb 2013 08:30:21 +0000 (09:30 +0100)]
Describe format of the monitoring agent HTTP queries

The previous patch was incomplete when erroneously pushed.

This patch, originally intended as part of the previous one, fixes it.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Tue, 19 Feb 2013 14:52:35 +0000 (15:52 +0100)]
Describe format of the monitoring agent HTTP queries

Update the monitoring agent design document adding the format of the HTTP
queries that will have to be used to query the monitoring agent.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRemove test of obsolete getNetworkUuid method
Helga Velroyen [Wed, 20 Feb 2013 12:07:02 +0000 (13:07 +0100)]
Remove test of obsolete getNetworkUuid method

This will remove the tests for the getNetworkUuid method.
The method will be obsolete after the changes regarding
identification of networks by UUID and not name are merged
into master. Will send another patch for removing the
actual method.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoSwitch the RPC module over to the multi interface
Iustin Pop [Wed, 20 Feb 2013 11:14:57 +0000 (12:14 +0100)]
Switch the RPC module over to the multi interface

This replaces the very-basic parMap of IO actions (fully serialised,
as parMap won't work here), to the multi interface.

This makes a simple "time gnt-node list" on a 6-node cluster go from
3.2s to ~0.9s, and allows even better parallelisation - before,
curlGetString was blocking, whereas the new interface does allow some
interleaving.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd a Ganeti-specific implementation of Curl Multi
Iustin Pop [Wed, 20 Feb 2013 10:49:07 +0000 (11:49 +0100)]
Add a Ganeti-specific implementation of Curl Multi

As we want to be able to run queries against multiple nodes in
parallel, and furthermore in parallel with other work, we need to
implement the Curl Multi interface (see libcurl-multi(3)).

This patch adds a Ganeti-specific such implementation, to be used
until upstream Curl bindings provide it. The implemented interface
(there are two 'multi' interfaces) is the older curl_multi_perform(3).

It has one downside (which is also, somewhat, and advantage): we use
polling instead of more properly select() or poll. This is due to how
waiting for FDs is implemented in Haskell: currently, it's not
possible to wait for multiple FDs at once nicely, so we'd have to fork
many threads for each FD to be watched, or alternatively one could use
FFI select, but that would block the entire runtime.

With the current poll method, the implementation achieves consistent
~100 RPC/s per second (with 10 multi interfaces running in parallel,
each with 10 easy handles), and over ~1 hour of runtime the memory
usage is stable, so memory allocation/deallocation (manual when
dealing with FFI) _seems_ to be well handled.

Future optimisations could be to move to curl_multi_socket_action(3),
which might allow better integration with the Haskell runtime.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd two utility functions for handling Either lists
Iustin Pop [Tue, 19 Feb 2013 13:26:48 +0000 (14:26 +0100)]
Add two utility functions for handling Either lists

These two functions permit operating in bulk on only the Left or Right
values in the original list, then reassembling the list back in the
original order.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoSimplify RPC error cases
Iustin Pop [Fri, 30 Nov 2012 01:24:56 +0000 (02:24 +0100)]
Simplify RPC error cases

This patch removes the node from the RPC error constructurs
CurlLayerError and OfflineNodeError. The rationale is that we anyway
return tuples (node, result), and removing this duplication allows
simplified signatures/calls in the execution of RPC calls.

Note: this was sent before as well, resending on top of current codebase.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoReduce duplication of curl options computation
Iustin Pop [Fri, 30 Nov 2012 01:36:57 +0000 (02:36 +0100)]
Reduce duplication of curl options computation

Some curl option are request-specific, but not node specific: e.g. rpc
timeout, etc. The patch changes the HttpClientRequest type so that we
can pre-seed such options, instead of rebuilding the list in each
individual request execution.

Note: this was sent before and LGTMed, but on a different codebase, so
resending an updated version.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoSwitch the curl bindings from optional to required
Iustin Pop [Fri, 15 Feb 2013 13:08:17 +0000 (14:08 +0100)]
Switch the curl bindings from optional to required

Currently, we support curl being optional via some sporting exercises:
ifdefs in the code, data types that represent 'Curl is disabled'
state, etc. However, with the future work on RPC, we would have to
even make the dependencies list conditional on it, etc. This is too
much work, when the curl library is included even in stable
distributions.

This patch changes curl from option to required, the same as the other
base libraries.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoqa_config.AcquireNode: Use sort key function
Michael Hanselmann [Wed, 6 Feb 2013 13:04:47 +0000 (14:04 +0100)]
qa_config.AcquireNode: Use sort key function

Use a sort key function instead of using a comparing function (“cmp=…”).
The latter is not supported in Python 3 and using a sort key function is
easier.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_config: Add __repr__ for instance/node classes
Michael Hanselmann [Wed, 6 Feb 2013 13:04:43 +0000 (14:04 +0100)]
qa_config: Add __repr__ for instance/node classes

Having a readable representation makes debugging easier.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoLocking fixes regarding Issue 324
Dimitris Aragiorgis [Tue, 19 Feb 2013 17:41:48 +0000 (19:41 +0200)]
Locking fixes regarding Issue 324

LUNetworkConnect/LUNetworkDisconnect, in case locking is used, might
lock instances that exist in the requested node group. The acquired
locks should be checked if they are correct at the beginning of
CheckPrereq() via _CheckNodeGroupInstances().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoTest "GetNodeInfo" for Xen hypervisor
Michael Hanselmann [Wed, 6 Feb 2013 13:56:03 +0000 (14:56 +0100)]
Test "GetNodeInfo" for Xen hypervisor

This patch adds unit tests for success and failure of the “GetNodeInfo”
method for the Xen hypervisor abstractions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoFix small typo in a docstring
Iustin Pop [Wed, 20 Feb 2013 14:57:10 +0000 (15:57 +0100)]
Fix small typo in a docstring

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoQA: Add validation for cluster name
Michael Hanselmann [Wed, 6 Feb 2013 11:40:52 +0000 (12:40 +0100)]
QA: Add validation for cluster name

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Acquire instance via method
Michael Hanselmann [Wed, 6 Feb 2013 10:15:35 +0000 (11:15 +0100)]
QA: Acquire instance via method

Also make “used” a property.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>