- Dec 04, 2012
-
-
Iustin Pop authored
If TIsLength is applied to a non-container item, it will fail (type error) due to invalid application of len(). Since this can happen on user-supplied data, we add an explicit TList/TTuple check (the TTuple test is a new one). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 30, 2012
-
-
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>
-
- 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 23, 2012
-
-
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>
-
- Nov 21, 2012
-
-
Michael Hanselmann authored
Some type descriptions are rather long. If "None" is listed at the end or somewhere in between it is easily missed. Therefore it should be at the beginning, e.g. "None or (long description)". Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 20, 2012
-
-
Iustin Pop authored
Currently, ht.py uses a bad terminology for positive/non-negative numbers. Per http://en.wikipedia.org/wiki/Positive_number , this is the correct terminology: - A number is positive if it is greater than zero. - A number is negative if it is less than zero. - A number is non-negative if it is greater than or equal to zero. - A number is non-positive if it is less than or equal to zero. So this patch renames things as follows: - TPositiveInt ⇒ TNonNegativeInt - TStrictPositiveInt ⇒ TPositiveInt - TMaybePositiveInt ⇒ dropped, not used anywhere - TMaybeStrictPositiveInt ⇒ TMaybePositiveInt - TPositiveFloat ⇒ TNonNegativeFloat - TStrictNegativeInt ⇒ TNegativeInt Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Sep 12, 2012
-
-
René Nussbaumer authored
Now that we've the refactoring done, we can easily add the new mode and everything works. Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Feb 01, 2012
-
-
Michael Hanselmann authored
Replaces some uses of TOr(TNone, TListOf(…)). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Jan 18, 2012
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 12, 2011
-
-
Michael Hanselmann authored
This will be used to add some more details to type descriptions, e.g. on opcode parameters or result values. The implementation is very similar to “WithDesc”. I chose to use “[…]” after finding “/*…*/” hard to read and spot. At some we'll have to introduce proper formatting (e.g. using HTML). Example with a comment: List of ((Length 2) and (Item 0 is (NonEmptyString [name of changed parameter]), item 1 is Anything)) Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Michael Hanselmann authored
Instead of a rather complicated expression only “JobId” is output. Job ID lists (like generated by “SubmitManyJobs”) are limited to two-item lists. Unittests are added. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Jul 21, 2011
-
-
Michael Hanselmann authored
With this change users of the “SubmitManyJobs” interface can use relative job dependencies. Relative job IDs in dependencies are resolved before handing the job off to the workerpool. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 12, 2011
-
-
Michael Hanselmann authored
Explicitely defining “__call__” silences a pylint warning when wrapped type check functions are used directly. I had no idea pylint is this intelligent. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 11, 2011
-
-
Michael Hanselmann authored
Places which receive floats can usually also deal with integers, e.g. OpTestDelay. Tests are added and the new check function is used for the aforementioned opcode and verifying query results. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- May 30, 2011
-
-
Michael Hanselmann authored
This fixes a unittest failure on 32 bit systems. A recently added unittest for ht.TJobId uses a rather large number (2347625220). On 64 bit systems it is stored as “int”. On 32 bit systems however, Python uses “long”. The two types can be intermixed in Python as the interpreter will take care of conversions. If one processed too many jobs (2**31) on a 32 bit system, ht would no longer accept the job IDs. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- May 27, 2011
-
-
Michael Hanselmann authored
The check for container items is useful for tuples and/or lists with non-uniform values. The “anything” check can be used when any value should be accepted for an item. The job ID check, which uses the regexp check, will be used for expressing opcode dependencies on other jobs. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- May 17, 2011
-
-
Michael Hanselmann authored
This allows checking specific dictionary items, unlike TDict or TDictOf. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Mar 09, 2011
-
-
René Nussbaumer authored
This delays the invocation of the power on of the next node. So if you power on a bunch of nodes it will not blow the fuse. Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Feb 04, 2011
-
-
Michael Hanselmann authored
This patch adds text descriptions to all T* checks. Converting to a string (e.g. str(ht.TNone)) will produce a user-readable text. This will be used for Opcode parameter documentation. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jan 25, 2011
-
-
Michael Hanselmann authored
This replaces a number of equal “ht.TOr(ht.TDict, ht.TNone)” checks. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jan 04, 2011
-
-
Michael Hanselmann authored
See inline comment. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Oct 13, 2010
-
-
Iustin Pop authored
This is for cleanup, and for later reuse in other parts of the code (outside of LUs). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-