- Nov 12, 2012
-
-
Iustin Pop authored
Some options have defaults that depend on the environment, and we could handle these in two ways: - use a place-holder value (e.g. data X a = Default | Custom a) that is later read from the environment - move the options list to IO monad, where it can read the environment, etc. The second option allows also displaying the actual defaults in the `--help' output, even though it's not as nice, so I went with it. This patch only changes the option types, without actually changing any options yet. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
The "starting" message is changed to match the Python one, and in case the preparation fails, we also log the error (beside printing it on stderr or writing it to the error reporting pipe), as at this time logging is usually set up. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The luxi binding is now annotated for better readability. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently, the writing of the PID file uses a "standard" error reporting: catch exception, transform it into a 'Result' type, leave handling of that to the caller. However, for daemon startup, we actually want exceptions to be propagated up until the handler which will write the details to the pipe. This patch removes the writePidFile wrapper (and stops exporting it), and changes the code to simply annotate better the I/O error. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
It turns out that annotateIOError already exists in the standard library, with a different purpose (this made me waste 10 minutes trying to understand why the types were wrong…). Let's move this out of BasicTypes, since it's used only in Daemon.hs, and also rename it. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This changes the daemon reporting error to the same mechanism as in Python: use a pipe which is written to from the forked children. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This does the address parsing earlier, before we fork, for better/faster error reporting. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This will help with the general daemon split of prepare/run, and flag errors earlier in the startup. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently, we keep information about the "target" of a tag operation in a data type similar to (TagKind, Maybe String). This is unsafe, as nothing (at the type level) prevents us from accidentally having (TagCluster, Just "instance1.example.com"), or (TagInstance, Nothing). To fix this problem, we rename the current TagObject type to TagType (an internal utility type), and create TagObject as a better/safer data type (see the definition), which doesn't allow such possibilities in the future. The downside is that, since at encoding level (both opcode and luxi) this is done in an ugly way (type elements spread at the same level as level as other value), we have to add custom encoders/decoders. The encoder is shared between the OpCode and Luxi usage, the decoder is different however as Luxi uses custom decoding. This also fixes the recent breakage in confd w.r.t. QueryTags. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This is needed so that we have more flexibility in generating Luxi serialisation code (deserialisation is still custom). Also, only exceptions are now using the 'simple' field types, so we might be able later to convert and remove that TH code as well. Since we will use custom serialisation fields in the future, we change the order of serialisation for custom-save fields; Luxi uses positional as opposed to name-based ordering, so we need to keep this stable. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Doh, this is exactly the opposite of what we wanted… good thing no test failed so far :) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This can be improved, by taking all hardcoded names as parameters, to serve as a more-general "build save clause for a multi-constructor data type". I'm not renaming the function as well, since I don't know exactly how much we can abstract later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
- Nov 09, 2012
-
-
Michael Hanselmann authored
This way constants like “rapi.RAPI_ACCESS_WRITE” can be used in documentation. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 08, 2012
-
-
Michael Hanselmann authored
Commit 208a6cff just included empty docstrings. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Instead of being given the priority for acquiring locks by means of a parameter, mcpu will now call back. This is in preparation for implementing a command to change a job's priority on the fly and allows to change it while locks are being acquired (taking effect on the next lock acquire). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
* devel-2.6: http/__init__.py: Remove extraneous argument rapi.testutils: Add utility to format HTTP headers rapi.testutils: Return headers from mock utility http: Add wrapper for mimetools.Message Add missing tests for commit f0d22861 Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
* stable-2.6: http/__init__.py: Remove extraneous argument rapi.testutils: Add utility to format HTTP headers rapi.testutils: Return headers from mock utility http: Add wrapper for mimetools.Message Add missing tests for commit f0d22861 Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
pylint complained, I fixed it, and unfortunately pushed too early. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Once again this will be used by forthcoming RAPI test. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
A newly added test for RAPI will also verify the returned headers. A test in ganeti.rapi.client_unittest.py is split into smaller stand-alone tests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
A newly added piece of code will also have to parse headers, so having this wrapper saves us from copying this part of code. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This should be the last module rename, promise! We rename this to conform to the other hierarchies (e.g. Query), and to not have both Confd.hs and Confd/*.hs. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Dato Simó authored
Also, adjust comment to $(genOpCode) block to avoid repetition of "only". Signed-off-by:
Dato Simó <dato@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Dato Simó authored
In addition to ReqQueryTags in Luxi.hs, the TagObject ADT is also required for the "kind" attribute of OpTagsSet and OpTagsDel, which are coming to OpCodes.hs next. Hence, we move TagObject there, and adjust imports accordingly. Signed-off-by:
Dato Simó <dato@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 07, 2012
-
-
Michael Hanselmann authored
Commit f0d22861 changed the logic of gnt_instance._ConvertNicDiskModifications to also allow a parameter named “modify”. Unfortunately the corresponding unittest was not updated. An “if”/“else” condition is also merged. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This mirrors the code in the Python code base, and is required for clean error reporting during startup. This patch implements the basic infrastructure; the confd daemon is not yet modified to take advantage of this, just the types are adjusted. Also, the pipe-based error reporting will go in a future patch, once we can actually use that for reporting. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This is only in master, so needed to be fixed separately. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Instead of having to explicitely increment the value (“… += 1”), a call to next() is enough. These numbers should in no case be re-used (they are used for ordering tasks). Using “itertools.count” is useful here as it guarantees that a returned number won't be returned another time. Manual code for this could, over the course of time, gain unintended bugs. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Iustin Pop authored
* devel-2.6: Fix compatibility with newer Haskell libraries Fix gnt-instance console with xl Conflicts: Makefile.am (reordering, fixed) htools/Ganeti/Confd/Server.hs (hlint fixes on master) htools/Ganeti/Daemon.hs (hlint) htools/Ganeti/HTools/Backend/Rapi.hs (hlint) htools/Ganeti/HTools/ExtLoader.hs (hlint) htools/Ganeti/HTools/QC.hs (file renamed/split in master, fixed) htools/test.hs (we don't use maxDiscards, ignored) lib/constants.py (move to pathutils) lib/hypervisor/hv_xen.py (move to pathutils) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
* stable-2.6: Fix compatibility with newer Haskell libraries Fix gnt-instance console with xl Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
We had twice in the past days questions about devel/upload being "broken", since bash re-reads shell scripts during their run and this file can get regenerated due to Makefile changes. Since we only need this to be dynamically built for 3 variables, let's make the file static and read those three variables when it is run, instead of when it is built, which allows us to re-read the "latest version" of these vars as well. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This small patch fixes compatibility with a few newer Haskell libraries: - base 4.6, included with ghc 7.6, removed the deprecated 'catch' function from Prelude, so our "import Prelude hiding (catch)" is now an error; we workaround by using fully-qualified Control.Exception.catch name - containers 0.5 changed the signature of 'deleteFindMax'; we workaround by using separate 'findMax' and 'deleteMax' - QuickCheck 2.5 removed the 'maxDiscards' test parameter, replacing it with a much better 'maxDiscardsRatio'; however, until we can depend on that, we workaround by just removing it (we don't control anymore the maxDiscards, instead leaving it default; for our default test size, this is no change, as the default value is already 500, which is our default as well) and not printing it anymore Tested on Squeeze (+extra libs), Wheezy and experimental, which covers all supported GHC versions. Also, merging this in master will be a pain, but unless we want to stop supporting 2.6… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 06, 2012
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
- Rename xm-console-wrapper to xen-console-wrapper - Pass the xen command to use as a parameter Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This replaces direct calls to “os.access” and “os.path.exists”/“os.path.isfile”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@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>
-
Iustin Pop authored
This tests that the same Luxi calls are defined in Python and Haskell. It doesn't test yet that their serialisation is correct though. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
* devel-2.6: Disable E1101 on ganeti/http/server.py:424 Fix live migration under xl Don't check for xend port when using xl Conflicts: lib/hypervisor/hv_xen.py: trivial Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
* stable-2.6: Disable E1101 on ganeti/http/server.py:424 Fix live migration under xl Don't check for xend port when using xl Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-