- Nov 16, 2012
-
-
Michael Hanselmann authored
This was requested in issue 301. Before this patch, requests to “/2/query/*” and “/2/instances/*/console” would require authentication with a user with write access. Since that is not strictly necessary, a new user option named “read” is added. Console information can also be retrieved as a normal query, therefore the change applies there too. This was the first user option to be added after “write”, therefore quite a few changes were necessary. Documentation, including NEWS, is updated as well. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michele Tartara authored
They mimic their python counterparts. Added functions: * getSourceDir * testDataFilename * readTestData * readPythonTestData Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michele Tartara authored
Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 15, 2012
-
-
Michael Hanselmann authored
This allows the option to be re-used in other places. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
This allows offlining nodes that don't respond if they are part of a linux-HA cluster. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This allows controlling the cluster master role if the nodes are part of a linux-HA cluster. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently, THH.hs "injects" into the built code names of library functions like Text.JSON.makeObj, Ganeti.JSON.fromObj, etc. built directly from strings, via (e.g.) varE (mkName "makeObj") This means that the "makeObj" name must exist in the target module, i.o.w. must be imported there. This leads to the strange case of having to have imports that do not appear at all in the used (template) code, but are needed to satisfy this "hidden" dependency; look at Ganeti/Jobs.hs before this patch, for example. This is also not very obvious, because we usually import Text.JSON anyway; I only stumbled upon it while doing some cleanup work. So to clean this up, the current patch changes the THH.hs to use not string-derived, but identifier-derived names («'identifier» versus «mkName "identifier"»); this is better, as the names must be resolvable when compiling THH itself (once), and not when compiling the multiple derived modules. As you can see, this allows removal of extraneous imports from various modules. Background information: an `mkName "foo"` results in a name of flavour NameS (“An unqualified name; dynamically bound”) or alternatively to a qualified name, but still dynamically bound. Whereas what we want is a statically bound name: `'foo` results in a NameG flavour, “Global name bound outside of the TH AST: An original name”. One more explanation: the change is similar to going from 'x = eval "map"' to 'x = map'; the name is no longer dynamically evaluated, but statically when the module is compiled. In our case, previously names were bound at target module compile time, now they are bound at THH.hs compile time. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 14, 2012
-
-
Iustin Pop authored
This is not a quickcheck property, since it doesn't have any variable/arbitrary inputs. So let's make it a test case, and shorten a bit the name. Also, sorry for not catching this in the review. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Michael Hanselmann authored
Without this change, invalid lines or values would be silently ignored. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This test does not work properly if localstatedir is not “/etc”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This wasn't clearly documented until now. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Also add tests to ensure it's never allowed as a file storage path. A constant for the lock file is also added. 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 UID is there, the GID wasn't. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
In some cases it's nice to verify a function has been called exactly N times. This is going to be used in tests for remote commands. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This is similar to commit f5ce7613. A stable sort order makes changes between versions easier to find. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 13, 2012
-
-
Michael Hanselmann authored
Unlike existing tests, this actually tests RAPI at the interface with the HTTP server. This way authentification can also be tested. A test for “/2/query/…” is included as it's a bit special. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
This can be used to change the priority of a pending or running job (the latter only if there are unprocessed opcodes). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
A new LUXI request is added, in both Python and Haskell. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This is due to a feature request. Sometimes one wants to change the priority of a job after it has been submitted, e.g. after submitting an important job only to later notice many other pending jobs which will be processed first. Priority changes only take effect at the next lock acquisition or when the job is re-scheduled. The design is very similar to how jobs are cancelled. Unit tests for “_QueuedJob.ChangePriority” are included. Also rename “TestQueuedJob.test” to “TestQueuedJob.testError”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
The job ID is re-used as the task ID, as job IDs are unique. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
When a task is deferred it should receive the same task ID upon being returned to the pool. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
Using the task ID a pending task's priority can be changed. This will be used to change the priority of jobs in the workerpool. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Michael Hanselmann authored
To prepare for the addition of a new function allowing changing a pending task's priority, the internal data structure is slightly changed. The (optional) task ID is stored as part of the task entry. A new dictionary provides a mapping from the task ID to its task entry. If the task ID is None, the entry is not added to the map. Task entries used to be a tuple, but since modifying the priority requires changing an entry, they are changed to lists in this patch. Tuple items can not be modified. The underlying idea is from [1]. [1]: http://docs.python.org/library/heapq.html#priority-queue-implementation-notes Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Bernardo Dal Seno <bdalseno@google.com>
-
Iustin Pop authored
Some GHC flags are very useful, but only appear in more recent GHC versions. To support the use of such flags while still supporting older compilers, let's add conditional checks and enabling based on the results. Currently only `-fwarn-incomplete-uni-patterns` is enabled, which detects refutable patterns in lambda expressions and pattern bindings (e.g. "let (Just x) = y"); such constructs are bad as they can lead to runtime exceptions. Additionally, fix an existing such bad construct in a test case; we workaround it by using error, since that should never fail. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michele Tartara authored
Attoparsec is known to have had issues with parsing non-ASCII strings. This test makes sure that parsing of Unicode characters works fine. Signed-off-by:
Michele Tartara <mtartara@google.com> [iustin: small doc string fixes] Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michele Tartara authored
This will be needed for the data collectors of the monitoring agent. * Detection of the library * Creation of the appropriate variables * Update to the installation documentation Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
"make regen-vcs-version" is run at every ./devel/upload time, in order to have reasonably up-to-date information in the uploaded scripts/binaries. However, this means it currently triggers recompilation of (at least) Ganeti/Version.hs, and sometimes more than that. Since we only care about the contents of the file and not the timestamp, let's change the make rule so that it only updates the file if there are actually changes in the content, as checked by "cmp". This results in a much faster ./devel/upload, especially for small changes in the (non-Haskell) code, or when the code has already been compiled. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Sorry, I broke lint again :), by introducing two sub-standard changes. Additionally, this silences an older existing warning that only triggers with some versions of hlint (e.g. 1.8.28 which is present in Wheezy). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 12, 2012
-
-
Michael Hanselmann authored
The “_postfork_fn” parameter was only used for tests until now. To implement a good locking scheme, remote commands must also make use of this callback to release a lock when the command was successfully started (but did not yet finish). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
* devel-2.6: Improve error message when migration status fail Fix type error in kvm/GetMigrationStatus Fix PID file writing in Haskell daemons Conflicts (both trivial): htools/Ganeti/Daemon.hs (_writePidFile rename) lib/hypervisor/hv_kvm.py (master fixed an indentation issue) Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
* stable-2.6: Improve error message when migration status fail Fix type error in kvm/GetMigrationStatus Fix PID file writing in Haskell daemons Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Commit 6a1434d7 (“Make migration RPC non-blocking”) changed the API for reporting migration status, but has a small cosmetic bug: if the migration status if failure, but the RPC itself to get the status didn't fail, it shows the following error message: Could not migrate instance instance2: None since it always uses result.fail_msg, irrespective of which part of the if condition failed. This patch simply updates the msg if not already set, leading to: Could not migrate instance instance2: hypervisor returned failure Proper error display can be done once the migration status objects can return failure information as well, beside status. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Commit 6a1434d7 (“Make migration RPC non-blocking”) changed from raising HypervisorErrors to returning MigrationStatus objects. However, these objects don't have an "info" attribute, so they can't pass a reason back (which is in itself a bug); but the KVM hypervisor code attempts to do so, and fails at runtime with: Failed to get migration status: 'MigrationStatus' object has no attribute 'info' instead of the intended: Migration failed, aborting: too many broken 'info migrate' answers For now (on stable-2.6), let's just remove the "info" reason, and later we can add it back properly once we have a way to correctly represent migration status failures in the LU. This fixes issue 297. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently, the code uses createFile, which has the effect of always truncating the file. This is bad, as the content of the PID file is wiped even when we wouldn't be able to lock it! We switch to openFd (createFile is just a wrapper over that), and we use an explicit set of flags; defaultFileFlags is already safe (trunc=False), but I prefer to set it explicitly with our desired flags. Note that this bug doesn't manifest in normal usage, as daemon-util won't try to start the daemon if already running. But if anyone or anything does call ganeti-confd explicitly, the pid file will be emptied and the daemon will keep trying to be restarted forever… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
We need to change a few things, most importantly CLI options defaults, but otherwise we already used the path to files from functions which were already in the I/O monad, so we don't have to change much of the code flow. Additionally, Path.hs now has an explicit export list, to stop accidental leakage of symbols. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Currently, keyToFilename uses itself the default config path. In the light of making that an function in the IO monad, let's remove the "default" path functionality from this function and make it always require the config path; its caller, readSSConfFile, can then do the maybe/default path change. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
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>
-