ganeti-local
14 years agoCheck for tabs and long lines in Python code
Michael Hanselmann [Fri, 11 Sep 2009 11:01:26 +0000 (13:01 +0200)]
Check for tabs and long lines in Python code

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years ago.gitignore: Ignore distcheck directories
Michael Hanselmann [Fri, 11 Sep 2009 12:35:49 +0000 (14:35 +0200)]
.gitignore: Ignore distcheck directories

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoWrap lines over 80 characters
Michael Hanselmann [Fri, 11 Sep 2009 12:28:00 +0000 (14:28 +0200)]
Wrap lines over 80 characters

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agocmdlib: Fix typo in variable name
Michael Hanselmann [Fri, 11 Sep 2009 10:06:14 +0000 (12:06 +0200)]
cmdlib: Fix typo in variable name

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoMakefile: Move lengthy variable list to separate variable
Michael Hanselmann [Thu, 10 Sep 2009 16:21:55 +0000 (18:21 +0200)]
Makefile: Move lengthy variable list to separate variable

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoMove LoadModule function to ganeti.build
Michael Hanselmann [Thu, 10 Sep 2009 15:42:27 +0000 (17:42 +0200)]
Move LoadModule function to ganeti.build

It should only be used at build-time.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoAdd new ganeti.build namespace
Michael Hanselmann [Thu, 10 Sep 2009 15:41:41 +0000 (17:41 +0200)]
Add new ganeti.build namespace

This will be used to store build-time Python code.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoupload: Use more compatible regular expression
Michael Hanselmann [Mon, 7 Sep 2009 17:29:14 +0000 (19:29 +0200)]
upload: Use more compatible regular expression

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agomcpu: formatting/indenting fix
Luca Bigliardi [Wed, 9 Sep 2009 09:46:25 +0000 (10:46 +0100)]
mcpu: formatting/indenting fix

Small fix for a mistake done by bad editor settings.

Signed-off-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd bash completion for --node node1[:node2]
Michael Hanselmann [Fri, 4 Sep 2009 15:08:51 +0000 (17:08 +0200)]
Add bash completion for --node node1[:node2]

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd more debugging to bash completion
Michael Hanselmann [Fri, 4 Sep 2009 15:07:28 +0000 (17:07 +0200)]
Add more debugging to bash completion

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd simple unittest for manpages
Michael Hanselmann [Fri, 4 Sep 2009 11:52:00 +0000 (13:52 +0200)]
Add simple unittest for manpages

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoFix small error in gnt-job manpage
Michael Hanselmann [Fri, 4 Sep 2009 11:51:38 +0000 (13:51 +0200)]
Fix small error in gnt-job manpage

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd locking doc to Ganeti documentation
Michael Hanselmann [Fri, 4 Sep 2009 11:29:27 +0000 (13:29 +0200)]
Add locking doc to Ganeti documentation

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd ipsec hook to .gitignore
Michael Hanselmann [Fri, 4 Sep 2009 11:24:07 +0000 (13:24 +0200)]
Add ipsec hook to .gitignore

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoEven more style fixes
Michael Hanselmann [Thu, 3 Sep 2009 16:15:50 +0000 (18:15 +0200)]
Even more style fixes

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoKVM hypervisor: Use ReadFile
Michael Hanselmann [Thu, 3 Sep 2009 15:41:41 +0000 (17:41 +0200)]
KVM hypervisor: Use ReadFile

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoA few style fixes
Michael Hanselmann [Thu, 3 Sep 2009 15:40:51 +0000 (17:40 +0200)]
A few style fixes

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd RAPI resource to redistribute config
Michael Hanselmann [Thu, 3 Sep 2009 14:05:33 +0000 (16:05 +0200)]
Add RAPI resource to redistribute config

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd simple unittest for remote API docs
Michael Hanselmann [Thu, 3 Sep 2009 10:28:14 +0000 (12:28 +0200)]
Add simple unittest for remote API docs

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agorapi doc: Add …/nodes/[name] and …/instances/[name]/reinstall
Michael Hanselmann [Wed, 2 Sep 2009 11:56:16 +0000 (13:56 +0200)]
rapi doc: Add …/nodes/[name] and …/instances/[name]/reinstall

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoAdd simple unittest for hooks documentation
Michael Hanselmann [Thu, 3 Sep 2009 14:35:09 +0000 (16:35 +0200)]
Add simple unittest for hooks documentation

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoUpdate hooks documentation
Michael Hanselmann [Wed, 2 Sep 2009 15:45:39 +0000 (17:45 +0200)]
Update hooks documentation

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoMove LoadModule function to utils
Michael Hanselmann [Thu, 3 Sep 2009 10:45:04 +0000 (12:45 +0200)]
Move LoadModule function to utils

It can be used by unittests for daemons/* or scripts/*.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoutils.CalculateDirectorySize: Don't redefine builtin
Michael Hanselmann [Wed, 2 Sep 2009 14:28:41 +0000 (16:28 +0200)]
utils.CalculateDirectorySize: Don't redefine builtin

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoUse ReadFile/WriteFile in more places
Michael Hanselmann [Thu, 3 Sep 2009 10:43:13 +0000 (12:43 +0200)]
Use ReadFile/WriteFile in more places

This survived QA, burnin and unittests.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

14 years agoMakefile: add IPsec hook
Luca Bigliardi [Mon, 31 Aug 2009 12:34:54 +0000 (13:34 +0100)]
Makefile: add IPsec hook

Enable creation and dist for IPsec hook.

Signed-off-by: Luca Bigliardi <shammash@google.com>

14 years agoExample IPsec hook
Luca Bigliardi [Mon, 10 Aug 2009 16:25:35 +0000 (17:25 +0100)]
Example IPsec hook

This hook is a simple example which automatically configures a basic IPsec link
among all the nodes of a cluster.

Signed-off-by: Luca Bigliardi <shammash@google.com>

14 years agognt-cluster watcher: Show more information
Michael Hanselmann [Mon, 31 Aug 2009 15:59:25 +0000 (17:59 +0200)]
gnt-cluster watcher: Show more information

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoconfd: add cluster master query
Guido Trotter [Mon, 31 Aug 2009 14:54:20 +0000 (15:54 +0100)]
confd: add cluster master query

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoconfd/querylib: fix docstrings
Guido Trotter [Mon, 31 Aug 2009 14:58:05 +0000 (15:58 +0100)]
confd/querylib: fix docstrings

They were cut&paste from the first example queries, rather than
documenting the current ones.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoconfd: avoid spamming the logfile
Guido Trotter [Fri, 28 Aug 2009 15:18:17 +0000 (18:18 +0300)]
confd: avoid spamming the logfile

When confd is disabled we don't want to be noticed every timer interval.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoRemove SimpleConfigReader.GetHypervisorType
Guido Trotter [Mon, 31 Aug 2009 15:01:41 +0000 (16:01 +0100)]
Remove SimpleConfigReader.GetHypervisorType

We haven't had that config file entry for a while.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoMerge commit 'origin/next' into branch-2.1
Michael Hanselmann [Mon, 31 Aug 2009 13:57:39 +0000 (15:57 +0200)]
Merge commit 'origin/next' into branch-2.1

* commit 'origin/next':
  Return cluster tags from LUQueryClusterInfo

Conflicts:
lib/cmdlib.py: Trivial

14 years agoReplace BINDIR variable as well
Luca Bigliardi [Mon, 31 Aug 2009 12:27:04 +0000 (13:27 +0100)]
Replace BINDIR variable as well

Add bindir to the list of variables replaced at make time.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoReturn cluster tags from LUQueryClusterInfo
Michael Hanselmann [Mon, 31 Aug 2009 10:07:52 +0000 (12:07 +0200)]
Return cluster tags from LUQueryClusterInfo

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agodevel/upload: Build in parallel
Michael Hanselmann [Mon, 31 Aug 2009 09:37:26 +0000 (11:37 +0200)]
devel/upload: Build in parallel

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoMerge branch 'next' into branch-2.1
Michael Hanselmann [Fri, 28 Aug 2009 15:33:37 +0000 (17:33 +0200)]
Merge branch 'next' into branch-2.1

* next:
  Add script to clean archived jobs after 21 days
  rapi: export more static node information
  Pass the correct signal to handlers
  cli: Use ToStdout/ToStderr instead of print
  Fix small typo in gnt-node
  Simplify handling of boolean args in rapi
  Fix checks in LUSetNodeParms for the master node
  Improve the example startup script
  Fix insserv dependencies

Conflicts:
Makefile.am: added ganeti-cleaner
doc/examples/ganeti.initd.in: Iustin's init script improvements
lib/cli.py: Trivial (ToStderr changes)

14 years agoAdd more bash completion metadata for options
Michael Hanselmann [Thu, 27 Aug 2009 17:30:09 +0000 (19:30 +0200)]
Add more bash completion metadata for options

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoBash completion: Implement dynamic option value completion
Michael Hanselmann [Thu, 27 Aug 2009 17:29:23 +0000 (19:29 +0200)]
Bash completion: Implement dynamic option value completion

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoBash completion: Add function to get all iallocators
Michael Hanselmann [Thu, 27 Aug 2009 17:26:36 +0000 (19:26 +0200)]
Bash completion: Add function to get all iallocators

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoBash completion: Simplify option completion
Michael Hanselmann [Thu, 27 Aug 2009 16:43:41 +0000 (18:43 +0200)]
Bash completion: Simplify option completion

This makes the output file quite a bit smaller and is needed
in preparation for non-static option completion (e.g. list of
nodes).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoBash completion: Support for --foo=bar option format
Michael Hanselmann [Thu, 27 Aug 2009 15:36:22 +0000 (17:36 +0200)]
Bash completion: Support for --foo=bar option format

That is with the equal sign.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoBash completion: Small optimizations
Michael Hanselmann [Thu, 27 Aug 2009 15:35:36 +0000 (17:35 +0200)]
Bash completion: Small optimizations

$2 doesn't contain the correct value when completing something like
"--disk-template=…". Getting it via COMP_WORDS is better.

Short options (e.g. -I) can't have an equal sign.

Also add useful debugging commands for development.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoFix QA test for “gnt-node evacuate”
Michael Hanselmann [Fri, 28 Aug 2009 10:44:36 +0000 (12:44 +0200)]
Fix QA test for “gnt-node evacuate”

Before the arguments weren't valid.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoConfd: don't fail if the config doesn't load
Guido Trotter [Fri, 28 Aug 2009 12:03:39 +0000 (15:03 +0300)]
Confd: don't fail if the config doesn't load

Rather than quitting we'll just continue to poll the config at a slow
rate, hoping that sooner or later we'll get it back. This allows also
working on non-MC nodes, and smoothly transitioning from MC to non-MC,
other than dealing with a few temporary breakages.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoconfd: start in polling mode
Guido Trotter [Fri, 28 Aug 2009 13:59:07 +0000 (16:59 +0300)]
confd: start in polling mode

This allows us not to enable the inotify handler immediately, and thus
to make it easier for us should the config file not exist at all.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoConfdProcessor: add disabled state
Guido Trotter [Fri, 28 Aug 2009 11:57:38 +0000 (14:57 +0300)]
ConfdProcessor: add disabled state

This is a state the processor will get in, if it fails to load the
config.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoMove SimpleConfigReader creation to ConfdProcessor
Guido Trotter [Fri, 28 Aug 2009 11:05:54 +0000 (14:05 +0300)]
Move SimpleConfigReader creation to ConfdProcessor

This will be useful to make ConfdProcessor aware of a config failure,
without quitting confd.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoconfd: s/confd_event_handler/inotify_handler/
Guido Trotter [Fri, 28 Aug 2009 12:07:01 +0000 (15:07 +0300)]
confd: s/confd_event_handler/inotify_handler/

In a case we don't encounter frequently (file modified but not
overwritten) the notify handler we use is called with a wrong name.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd script to clean archived jobs after 21 days
Michael Hanselmann [Fri, 28 Aug 2009 14:37:14 +0000 (16:37 +0200)]
Add script to clean archived jobs after 21 days

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoImplement timers in confd
Guido Trotter [Sun, 23 Aug 2009 17:13:55 +0000 (20:13 +0300)]
Implement timers in confd

Timers are used both for checking for inotify failures, and for polling,
should inotify notices become too frequent.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoconstants: add confd reload and rate limit times
Guido Trotter [Sun, 23 Aug 2009 17:07:42 +0000 (20:07 +0300)]
constants: add confd reload and rate limit times

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfdInotifyEventHandler.enable: use InotifyError
Guido Trotter [Sun, 23 Aug 2009 15:57:48 +0000 (16:57 +0100)]
ConfdInotifyEventHandler.enable: use InotifyError

Rather than raising ConfdFatalError directly
ConfdInotifyEventHandler.enable raises InotifyError should it not be
able to configure inotify, allowing the caller to decide what to do.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoAdd errors.InotifyError
Guido Trotter [Fri, 21 Aug 2009 10:18:33 +0000 (12:18 +0200)]
Add errors.InotifyError

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfdInotifyEventHandler, move to a callback
Guido Trotter [Sun, 23 Aug 2009 15:50:01 +0000 (16:50 +0100)]
ConfdInotifyEventHandler, move to a callback

ConfdInotifyEventHandler used to reload the config whenever a
notification arrived. Moving to a callback system, so that
ConfdConfigurationReloader can be responsible for that functionality.

Additionally the inotify class no longer reenables itself automatically,
but just notifies the callback if it's been disabled, and waits for its
call to enable(). This allows, should ConfdConfigurationReloader decide
it wants to move to polling, to avoid having a double enable()/disable()
call.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoMove creation of inotify handler to a new class
Guido Trotter [Sun, 23 Aug 2009 15:42:59 +0000 (16:42 +0100)]
Move creation of inotify handler to a new class

This class will be responsible for managing inotify notifications,
timers, and rate-limiting reloads. For now none of these features is
implemented. :)

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfdInotifyEventHandler: add enable/disable
Guido Trotter [Sun, 23 Aug 2009 15:36:07 +0000 (16:36 +0100)]
ConfdInotifyEventHandler: add enable/disable

Make possible to enable and disable the inotify event handler.  The
inotify handler will remain enabled, unless explicitely told to disable
itself.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoSimpleConfigReader: handle stat() errors
Guido Trotter [Fri, 28 Aug 2009 08:18:04 +0000 (11:18 +0300)]
SimpleConfigReader: handle stat() errors

Also, catch EnvironmentError, rather than IOError, when trying to read
the file.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoEncode the actual exception raised by LU execution
Iustin Pop [Thu, 27 Aug 2009 13:02:50 +0000 (15:02 +0200)]
Encode the actual exception raised by LU execution

Currently, the actual exception raised during an LU execution (one of
OpPrereqError, OpExecError, HooksError, etc.) is lost because the
jqueue.py code simply sets that to a str(err), and the code in cli.py
simply passes that string to OpExecError.

This patch moves to encoding the errors as per errors.EncodeError and
changes the cli code to parse and raise that (if possible).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoMove the luxi error handling into errors.py
Iustin Pop [Thu, 27 Aug 2009 13:01:23 +0000 (15:01 +0200)]
Move the luxi error handling into errors.py

Currently the luxi error handling is hardcoded as special encoding on
the masterd-side and special decoding on the client side. This patch
moves it to errors.py such that other parts of the code can reuse the
same encoding.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoRemove watcher pause file 1h past end time
Michael Hanselmann [Wed, 26 Aug 2009 16:07:14 +0000 (18:07 +0200)]
Remove watcher pause file 1h past end time

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoganeti-watcher: Don't run if paused
Michael Hanselmann [Wed, 26 Aug 2009 14:47:01 +0000 (16:47 +0200)]
ganeti-watcher: Don't run if paused

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agognt-cluster: Add CLI for watcher pause
Michael Hanselmann [Wed, 26 Aug 2009 15:50:07 +0000 (17:50 +0200)]
gnt-cluster: Add CLI for watcher pause

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd file to pause watcher for a certain duration
Michael Hanselmann [Wed, 26 Aug 2009 15:59:07 +0000 (17:59 +0200)]
Add file to pause watcher for a certain duration

This can be used during maintenance work.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agocli._Argument: Remove unused, optional “suggest” parameter
Michael Hanselmann [Wed, 26 Aug 2009 14:44:58 +0000 (16:44 +0200)]
cli._Argument: Remove unused, optional “suggest” parameter

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agobash completion: Allow arguments with min < max arguments
Michael Hanselmann [Wed, 26 Aug 2009 14:43:43 +0000 (16:43 +0200)]
bash completion: Allow arguments with min < max arguments

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoganeti-masterd: Master voting in separate process
Michael Hanselmann [Wed, 26 Aug 2009 11:02:35 +0000 (13:02 +0200)]
ganeti-masterd: Master voting in separate process

One shouldn't fork a Python process after using threads. Master
voting is done before forking (utils.Daemonize), but it also uses
threads. Hence it's now called from a separate process.

This patch also fixes the check function to actually exit if
the current machine is not the master (introduced in 04ccf5e9).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoganeti-masterd: Add helper to run function in separate process
Michael Hanselmann [Wed, 26 Aug 2009 15:30:43 +0000 (17:30 +0200)]
ganeti-masterd: Add helper to run function in separate process

This will be used to do the master voting.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoGenerateSecret: specify the length of the secret
Luca Bigliardi [Wed, 26 Aug 2009 10:34:14 +0000 (11:34 +0100)]
GenerateSecret: specify the length of the secret

Add a parameter to specify the length of the bytes sequence represented by the
returned hex string. Defaulting to 20 so it's compatible with previous SHA1
hash.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agocmdlib: Add some messages to LUExportInstance
Michael Hanselmann [Wed, 26 Aug 2009 11:30:40 +0000 (13:30 +0200)]
cmdlib: Add some messages to LUExportInstance

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoStyle fixes for ganeti-*
Michael Hanselmann [Tue, 25 Aug 2009 15:51:57 +0000 (17:51 +0200)]
Style fixes for ganeti-*

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoganeti-noded: Close listening socket in child
Michael Hanselmann [Tue, 25 Aug 2009 15:52:31 +0000 (17:52 +0200)]
ganeti-noded: Close listening socket in child

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoDocument cluster destroy hook
Luca Bigliardi [Tue, 25 Aug 2009 15:50:38 +0000 (16:50 +0100)]
Document cluster destroy hook

Add documentation about new cluster-destroy-post hook.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoLUDestroyCluster: run hooks
Luca Bigliardi [Tue, 25 Aug 2009 15:19:47 +0000 (16:19 +0100)]
LUDestroyCluster: run hooks

Run post hooks on master node before it's removed.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoLUDestroyCluster: hooks support
Luca Bigliardi [Tue, 25 Aug 2009 14:49:29 +0000 (15:49 +0100)]
LUDestroyCluster: hooks support

We're going to call hooks from its Exec method so LUDestroyCluster has to
support them.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoRun unittests in a temporary directory
Michael Hanselmann [Tue, 25 Aug 2009 12:13:33 +0000 (14:13 +0200)]
Run unittests in a temporary directory

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoFix building in a different directory
Michael Hanselmann [Tue, 25 Aug 2009 11:50:01 +0000 (13:50 +0200)]
Fix building in a different directory

Also add build-bash-completion to EXTRA_DIST.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd script to run build commands in temporary directory
Michael Hanselmann [Tue, 25 Aug 2009 12:14:17 +0000 (14:14 +0200)]
Add script to run build commands in temporary directory

Python always compiles imported modules. By running these targets
in a temporary directory we don't pollute the source tree.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoMakefile: Use BUILT_SOURCES
Michael Hanselmann [Tue, 25 Aug 2009 11:56:32 +0000 (13:56 +0200)]
Makefile: Use BUILT_SOURCES

These are always built before anything else.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoSimplify manpage building
Michael Hanselmann [Tue, 25 Aug 2009 09:47:24 +0000 (11:47 +0200)]
Simplify manpage building

This eliminates one temporary directory in the process.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoMakefile: Fix docbook2man error message
Michael Hanselmann [Mon, 24 Aug 2009 15:31:09 +0000 (17:31 +0200)]
Makefile: Fix docbook2man error message

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoHandle more errors in bash completion
Michael Hanselmann [Tue, 25 Aug 2009 12:32:32 +0000 (14:32 +0200)]
Handle more errors in bash completion

Don't print error messages if cluster hasn't been initialized yet.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoHooksMaster: fix RunPhase logging
Luca Bigliardi [Tue, 25 Aug 2009 15:03:09 +0000 (16:03 +0100)]
HooksMaster: fix RunPhase logging

In case of complete failure results is empty, return immediately
(tnx unittests).

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoLURemoveNode: no logs running post on removed node
Luca Bigliardi [Tue, 25 Aug 2009 14:15:58 +0000 (15:15 +0100)]
LURemoveNode: no logs running post on removed node

Do not log results from hooks ran on the removed node as now it's done by
RunPhase.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoHooksMaster: logging hooks in RunPhase
Luca Bigliardi [Tue, 25 Aug 2009 14:11:53 +0000 (15:11 +0100)]
HooksMaster: logging hooks in RunPhase

Extend RunPhase so it will log hooks results in POST phase.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agorapi: export more static node information
Iustin Pop [Tue, 25 Aug 2009 10:36:05 +0000 (12:36 +0200)]
rapi: export more static node information

Currently not all static node information is exported over rapi, and
this makes it less complete than gnt-node list. This patch attempts to
reduce the difference.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoDocument post cluster initialization LU
Luca Bigliardi [Tue, 25 Aug 2009 11:56:57 +0000 (12:56 +0100)]
Document post cluster initialization LU

Update hooks documentation with the new opcode (not deleting OP_INIT_CLUSTER
from obsolete operations because the name is different).

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agonode-remove post on removed node
Luca Bigliardi [Mon, 24 Aug 2009 16:48:43 +0000 (17:48 +0100)]
node-remove post on removed node

Run post phase of node-remove on the removed node as well.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoHooksMaster: document raised exception
Luca Bigliardi [Tue, 25 Aug 2009 10:22:33 +0000 (11:22 +0100)]
HooksMaster: document raised exception

HooksAbort is raised, but not documented.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoHooksMaster: list of nodes override
Luca Bigliardi [Mon, 24 Aug 2009 17:32:28 +0000 (18:32 +0100)]
HooksMaster: list of nodes override

Allow the caller of HooksMaster.RunPhase() to specify an alternative list of
nodes.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd burnin support for instance moves
Iustin Pop [Fri, 21 Aug 2009 14:23:16 +0000 (16:23 +0200)]
Add burnin support for instance moves

This patch adds support for instance moves in burnin. This means that
non-drbd instances finally get support for being moved.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoFix error output in LUSetClusterParams
Iustin Pop [Mon, 24 Aug 2009 14:53:39 +0000 (16:53 +0200)]
Fix error output in LUSetClusterParams

Before:
  gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm
  Failure: command execution error:
  Enabled hypervisors contains invalid entries: set([u'xem-pvm'])

After:
  gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm
  Failure: command execution error:
  Enabled hypervisors contains invalid entries: 'xem-pvm'

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoAdd ArgHost class
Michael Hanselmann [Mon, 24 Aug 2009 14:08:04 +0000 (16:08 +0200)]
Add ArgHost class

It expands to the hostnames known by bash.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoRe-introduce constants for most often used arguments
Michael Hanselmann [Mon, 24 Aug 2009 13:50:08 +0000 (15:50 +0200)]
Re-introduce constants for most often used arguments

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoUse script to generate bash completion
Michael Hanselmann [Mon, 24 Aug 2009 12:50:38 +0000 (14:50 +0200)]
Use script to generate bash completion

Completion for tools/burnin is not yet implemented. It needs to be
converted to definition-based options handling first.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd tools directory to constants
Michael Hanselmann [Mon, 24 Aug 2009 09:10:11 +0000 (11:10 +0200)]
Add tools directory to constants

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoConvert “burnin” to definition-based options
Michael Hanselmann [Mon, 24 Aug 2009 09:09:33 +0000 (11:09 +0200)]
Convert “burnin” to definition-based options

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoAdd more auto-completion metadata
Michael Hanselmann [Fri, 21 Aug 2009 13:24:19 +0000 (15:24 +0200)]
Add more auto-completion metadata

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoMake all options use cli_option
Michael Hanselmann [Mon, 24 Aug 2009 13:53:31 +0000 (15:53 +0200)]
Make all options use cli_option

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>