- Dec 20, 2012
-
-
Michael Hanselmann authored
If opportunistic locking is requested in the opcode, but no iallocator is used (not specified or no default), an error will be raised. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
- Dec 19, 2012
-
-
Michael Hanselmann authored
This is not a trivial s/frozenset/compat.UniqueFrozenset/, but rather only replaces “frozenset” where appropriate. Most of the places are “static” information that doesn't change after the module has been loaded. Some docstrings and code formatting (e.g. empty lines) issues are addressed as well. Some lines got too long and were wrapped. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Bernardo Dal Seno authored
Unit tests updated and expanded with an inheritance check. The flag has no effect yet. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 18, 2012
-
-
Michael Hanselmann authored
Commit 141d1489 was a bit too enthusiastic. The three parameters added to the list of parameters to be checked default to a value not evaluating to false, leading to a failure on cluster initialization. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 17, 2012
-
-
Michael Hanselmann authored
“_SPICE_ADDITIONAL_PARAMS” is supposed to be the full list of SPICE-related KVM hypervisor parameters with the exception of “HV_KVM_SPICE_BIND”. The new test checks if all parameters starting with “HV_KVM_SPICE_*” are included. Three previously missing parameters are added to the list. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
For some opcodes, the output is not "stable", and depends on the exact input values; this makes it harder to check consistency against Haskell code. To compensate for this, we add a way to override the formatting of the OP_DSC_FIELD; by default, this is always "%s", but if the OP_DSC_FORMATTER is defined (must be a callable), it is used to format the actual value. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 13, 2012
-
-
Michael Hanselmann authored
The watcher pause file should be set/unset on all nodes at once, not only the master node. For that a new RPC is needed. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
“TestWriteFile” was not renamed when adding the file based on “ganeti.utils.io_unittest-runasroot.py”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This addresses issue 218. When the number of inotify watches is exhausted, for example by being set too low from the beginning or by other programs, waiting for a job to change would just report a lost job (e.g. “Error checking job status: Job with id 7817 lost”). This patch changes the job watcher to no longer catch “errors.InotifyError” and, this is by far the larger part of this patch, adds unittests for this situation. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
- Add more checks, some of them are deliberately redundant - Descriptive error messages - Add comment describing order to “tools.ensure_dirs” - Avoid copying a list in an assertion in “tools.ensure_dirs” Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 12, 2012
-
-
Constantinos Venetsanopoulos authored
Change the "--disks" option validation, to just check the format of the dict and do not check whether the keys are included in the IDISK_PARAMS constant at OpCode level. This allows the passing of arbitrary parameters at the CLI, which will then be logically checked at LU level (inside CheckArguments). Currently, the check wrt to IDISK_PARAMS already happens in all related LUs (InstanceSetParams, InstanceCreate, InstanceRecreateDisks), with the use of ForceDictType(), so there is no need for additional checking code. Signed-off-by:
Constantinos Venetsanopoulos <cven@grnet.gr> Signed-off-by:
Iustin Pop <iustin@google.com> [iustin@google.com: fixed a unittest that needed adjustement] Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 11, 2012
-
-
Michael Hanselmann authored
When used instead of a plain call to “frozenset”, this would have avoided the issue fixed in commit e2dd6ece. The new function is located in the “compat” module as it will be used at module load time in most places and should therefore reside in a place with very few dependencies. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 07, 2012
-
-
Michael Hanselmann authored
Until now the error codes were not available from the RAPI client module. A newly added unit test ensures all error codes are contained in “ECODE_ALL”, as well as ensuring consistency between the RAPI client and the authoritative “errors” module. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Add verification code to mcpu to check an LU's locks. Two whitelists are provided to exclude LUs from the two tests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
- Dec 06, 2012
-
-
Michael Hanselmann authored
Older versions use “-----BEGIN RSA PRIVATE KEY-----” instead of “-----BEGIN PRIVATE KEY-----”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
The design for this is in “doc/design-node-add.rst”. The tool receives a JSON data structure on stdin and configures the node's daemon after verifying the received values. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 05, 2012
-
-
Michael Hanselmann authored
Commit 4679547e implemented the ability to change job's priority after it was submitted. The code contained a bug whereby it would modify the input data for an opcode, something the job queue shouldn't do (logical units do for historical reasons). This patch removes the line modifying the opcode input and adjusts the tests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 04, 2012
-
-
Michael Hanselmann authored
In the future instance creations might have a lock on all nodes as was the case until the implementation of opportunistic locking. Nodes for which the lock is not held will be shown to the iallocator plugin as if they were marked offline. This patch adds a new parameter named “node_whitelist” to “IAReqInstanceAlloc”. If set to a list, only nodes contained within are shown as online. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Michael Hanselmann authored
The network management code needs to verify a MAC address prefix. Instead of (ab)using NormalizeAndValidateMac, clean code should be used. Unit tests for NormalizeAndValidateMac are updated and new ones for NormalizeAndValidateThreeOctetMacPrefix are added. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 03, 2012
-
-
Michael Hanselmann authored
This code is going to be used by a new utility for setting up the node daemon. Unit tests are updated/added. Additionally, the certificate and key stored in “server.pem” are verified, too. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This patch adds a new parameter to “LockSet.acquire” named “opportunistic”. When enabled the lockset will try to acquire as many locks as possible, but it won't wait for them (with the exception of the lockset-internal lock in case the whole set is acquired). This is implemented by using a timeout of 0 seconds when acquiring individual locks. Commit 03c5291c made such acquisitions significantly cheaper. The most complicated code included in this patch is probably the helper function used to determine which mode to use and which timeout functions are needed. Full unit tests are included for the new and changed code (“locking.py”'s overall coverage is at 97%). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Configuring a node daemon on a newly added node will need all ssconf values. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
A new utility for configuring the node daemon will support a dry-run mode. This patch adds the necessary functionality to “ssconf.SimpleStore” and provides comprehensive tests for “SimpleStore.WriteFiles”. To enable the latter, a testing-only parameter specifying the lockfile was added to the class. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
The new utility for configuring the node daemon will have to check whether it received valid ssconf names. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 30, 2012
-
-
Iustin Pop authored
This is not comprehensive, since in Python one can't determine what is and what is not mutable; but I've added a few base cases (list, dict, set). The patch also improves (makes more uniform) the error messages in the parameter definitions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Dimitris Aragiorgis authored
TValueNone checks if a value is "none" and TMaybeValueNone is a wrapper of TOr(TValueNone, x). This is used by OpNetworkSetParam in order to reset a network value (e.g. mac_prefix, gateway, etc.) Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Also remove a superfluous empty line in test file. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 29, 2012
-
-
Michael Hanselmann authored
This patch adds descriptors to the “_CheckCIDR*” functions in opcodes and improves the descriptions generated by “ht.TInstanceOf”, thereby indirectly fixing bad type descriptions in the RAPI documentation. Before this patch: - (String and (<function _CheckCIDRAddrNotation at 0x2f…>)) - (Instance of (<class 'ganeti.opcodes.OpInstanceCreate'>)) After this patch: - (String and (IPv4 address)) - (Instance of (ganeti.opcodes.OpInstanceCreate)) Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
- Nov 28, 2012
-
-
Michael Hanselmann authored
A new tool for configuring the node daemon will also have to verify the cluster name, so it's better to have this function in a central place. In the process of moving it to ssconf it is also changed to use “SimpleStore” instead of reading the ssconf directly. Tests are updated. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Michael Hanselmann authored
Until now ssconf would limit the amount read from files to 128 KiB and silently ignored files larger than that. With this patch a check is added by using fstat(2) on the file descriptor while it's being read. There were no tests file ssconf at all, so some are added. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 27, 2012
-
-
Michael Hanselmann authored
A new tool to configure the node daemon will also have to load and verify JSON data. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Most tools had their own “SetupLogging” function, but they were all essentially the same. This patch adds a generic version to “utils.log” and provides unit tests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 26, 2012
-
-
Michael Hanselmann authored
A new method is added to check whether the LockSet-internal lock is held. This is the case after LockSet.acquire was called with locking.ALL_SET. Unit tests are updated, including one where the list of names must be empty. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 23, 2012
-
-
Michael Hanselmann authored
The new lock is similar to the BGL in the sense that it has its own level and there is only one. It is called “node allocation lock”. Logical units will use it to synchronize with instance creations, which in turn will start using opportunistic locks on nodes. Additionally, an assertion in GanetiLockManager gained a message. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
We have many cases in the code where we write TOr(TNone, a), so let's introduce a combinator that simplifies this case. Beside replacing the above with TMaybe(a), I did a few other parameter fixes: - noop change TOr(TNone, TDict) to TMaybeDict - noop change TOr(TNone, TNonEmptyString) to TMaybeString - OpClusterSetParams, change master netmask from any integer to a non-negative integer (I can move the last one to a separate patch if desired) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The network patches and an existing test added function-call based dict construction as opposed to literal sintax. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
- Nov 21, 2012
-
-
Michael Hanselmann authored
As per Iustin Pop's suggestion in <20121115131730.GX824@google.com> on <ganeti-devel@googlegroups.com>. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
As per Iustin Pop's suggestion in <20121115131730.GX824@google.com> on <ganeti-devel@googlegroups.com>. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
“locking.PipeCondition” and “locking.SharedLock” define “__repr__”, which until now was not tested at all. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Now that 2.6 is essentially finished and 2.7 going to be branched soon-ish, I thought it would be a good moment to replace some single quotes in test/*.py. Merge pains should be limited. In one place in test/ganeti.locking_unittest.py, spaces are added for assignments. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-