- Dec 19, 2012
-
-
Guido Trotter authored
Currently gnt-instance shutdown --force of an offline instance resets the offline status. Which of course is bad and completely unintended. Fix. (caught by the new qa tests) Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently, most network LUs simply use EINVAL instead of correct error codes; this patch tries to adjust the obvious cases. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
The code can loop directly over “self.wanted”, saving a lookup. An explicit loop is also replaced with a generator. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
LUNetworkConnect and LUNetworkDisconnect had very similar code to detect conflicts between instance's network interfaces and networks. This code factorizes the common part and does some cleanup: - Remove single-letter variable for lambda (“l”) - Don't repeat instance name in warning output - Fixed error messages to match style guide Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
The style guide says to use “import foo”-style imports, not “from foo import bar” unless it's a Ganeti module. There are some places with exceptions, but this one certainly isn't warranted. Also fix the import order. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Also do some minor code re-formatting. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This was not only copied for the networking fields in commit 306bed0e, but commit cfcea7ef fixed wrongly ordered parameters and didn't fix the original. Either way, this patch merges the two cases again. The newly added function is already tested through the tests for _GetLiveNodeField. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This makes entering the command easier. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
The list of query fields can be automatically generated. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
They should be in the same style as other descriptions. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
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>
-
Helga Velroyen authored
Small renaming to make the test more readable. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Helga Velroyen authored
This creates a number of node groups with up to 3 networks, serializes them and compares them with their python equvalents. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
This adds a network field to the NIC params and a list of networks to the node group type. It adjusts the nodegroup's unit tests accordingly. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
Networks will be properties of NicParams and NodeGroups. Therefore they need to be defined before those. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This patch removes code which is no longer used due to refactoring: - http.InitSsl, last usage removed in commit 33231500 (“Convert RPC client to PycURL”) - rapi.baserlib.MakeParamsDict, last usage remove in commit 4e5a68f8 (“RAPI: rlib1 removal”) - rapi.baserlib.ExtractField, last usage removed in commit 028c6b76 (“RAPI:Fix root list and unittest for it.”) - qa.qa_utils.AssertNotEqual, last real usage removed in commit 2f4b4f78 (“Simplify QA commands”) (but it was still imported for a while, until we extended pylint to run over the QA code as well) - qlang._IsHostname, added in commit f8638e28 (“Detect globbing patterns as query arguments”) but never used - cmdlib._BuildNetworkHookEnvByObject, last usage removed in commit f22433c0 (“Locking related fixes for networks”) - NLD constants, which are obsolete—the nbma project is no longer maintained and it's not working with current ganeti Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This patch is enabling split queries for jobs for gnt-node and rapi access (only for job listing, not job waiting). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This shouldn't live in the main Query module, since it's too node specific. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This adds support for job queries, including (basic) unit-tests. I've tested this for memory and cpu usage as follows: - 3600 jobs (live queue): - via masterd, default: ~1.1s (masterd: ~60MB ram) - via confd, default: ~1.1s (hconfd: ~25MB ram) - via masterd, id only: ~1.0s (masterd: ~57MB ram) - via confd, id only: ~0.2s (hconfd: ~15MB ram) - all jobs (128K in total, around 570MB size on disk): - via masterd, default: 1m22s (masterd cpu: 48s), masterd: 1.4G ram - via confd, default: 1m16s (hconfd cpu: 51s), hconfd: 570MB ram peak (peak only right before starting luxi send, hconfd decreases in RSS as results are streamed over luxi, back to ~18MB after the send) - via masterd, id only: ~49s (masterd cpu: 45s), masterd: 1.3G ram - via confd, id only: ~39s (hconfd cpu: 35s), hconfd: 110MB ram peak (right before luxi send, decreasing as results are sent, back to ~14MB after the send) Given this, and that in production it's not likely to have hundreds of thousand of job files, I believe the implementation is safe from this point of view. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This is required for QueryJobs implementation; we change makeSimpleFilter to support both string and integers as names. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This patch adds implementation for a read-only job queue module, together with "full" test (as full as can be in a lazy language…). One note about the behaviour of the job queue is the handling of opcodes that fail validation: the 'input' opcode actually is a meta-type, which can hold either a real opcode or a plain JSValue, so that we can still load jobs with invalid opcodes for querying. The only downside of this is that, as opposed to Python code, we can't show the correct summary for such an opcode - we try to parse the OP_ID but not the extended OP_DSC_FIELD-equivalent. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
I am very very unhappy with this patch. We have to do this, in order to be compatible with the Python code and behaviour, but there's lots of duplication; both the Python and the Haskell code will need to be cleaned up and simplified (we don't need QFF_* at all). For now though, this implements QffTimestamp and associated code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@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>
-
Bernardo Dal Seno authored
PVs don't need to be marked as unallocatable, as the code will ignore partially used PVs. exclusive_storage made a node parameter. Signed-off-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
Forgot to fix that after the review of patch "Haskell/python compatibility test for networks". Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Since this is a type that behaves non-standard, let's add some more test for "wrong" input values. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
As OpParams definitions are used at Template Haskell type, they don't get any coverage (although the values defined by them are actually used in unittests). However, we can at least test some of the functions defined in the module. This patch tests the failure modes of a few of the custom types in this module. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
"Use comparing" was not needed, and "Use on" can be solved by actually using on in the single case we have (the patch also reorders imports in that file). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
These test the newly-changed behaviour, and fix an inconsistency in the hs-check target (versus hs-coverage). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, this doesn't abort if multiple arguments are passed, and the error message for errors during file read has a duplicate "Error". Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This just ties in all the pieces so far and enables bash completion for it. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This patch adds support for parsing the command list out of a binary (very strict format), and then iterating over that and building the sub-commands options/arguments. It also does a bit of general cleanup in the script. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This will allow build-bash-completion to understand what is the list of commands that each binary supports, and then provide recursively completion support for each command. Note: by "fake", I mean we use hand-built output and hardcoded "--help-completion" matching, as opposed to automatically doing it via regular options. It could be possible in the future to use a two-staged command line parser, but for now not sure if it's worth it. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
No need to do a boolean-based lookup, we can use the regular association list lookup. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This allows usage information to display nicer help (like in Python). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the mon-collector binary is the only multi-command binary we have in Haskell. Not surprisingly therefore, its command line handling is not as robust as we need, not being able to support standard "--help" commands. This patch introduces generic multi-command handling, similar to the Python functionality (some parts missing, will be added in future patches), and switches mon-collector over to it. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
The signature of the personality definitions is so ugly that, at least, we should hide it a bit behind a type alias. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-