Statistics
| Branch: | Tag: | Revision:

root / lib / watcher @ f7f03738

# Date Author Comment
b8028dcf 12/19/2012 06:29 pm Michael Hanselmann

Replace frozenset with compat.UniqueFrozenset

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....

57fe4a5b 09/18/2012 06:11 pm Michael Hanselmann

Migrate lib/watcher/__init__.py from constants to pathutils

File system paths moved from constants to pathutils.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

fc3f75dd 09/03/2012 06:18 pm Iustin Pop

Fix decorator uses which crash newer pylint

Pylint version:

pylint 0.25.1,
astng 0.23.1, common 0.58.0

crashes when passing the fully-qualified decorator name with:

File "/usr/lib/pymodules/python2.7/pylint/checkers/base.py", line 161, in visit_function...
40b068e5 05/29/2012 12:12 pm Iustin Pop

Re-wrap some lines in watcher code

These were using exactly 80 chars, and I like them smaller.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

3ccb3a64 02/21/2012 05:23 pm Michael Hanselmann

Replace single- with double-quotes

In at least two cases "%s" is replaced with str(), too.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

2635bb04 01/06/2012 01:34 pm Michael Hanselmann

Move helper class from watcher to utils.io

“FileStatHelper” can be used together with “ReadFile” to a file's status
while it's opened. This avoids certain race conditions.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

aa224134 11/17/2011 03:49 pm Iustin Pop

Adapt watcher for ENABLE_CONFD

If confd is disabled, do not automatically restart it. Furthermore, we
can't run maintenance actions if it is disabled so log a warning.

Note that I haven't completely disabled the NodeMaintenance class with
ENABLE_CONFD = False because I think they are at two different levels...

2e5c33db 10/12/2011 02:01 pm Iustin Pop

Rename filter and filter_ to qfilter

We currently use 'filter' as the OpCode, QueryRequest and RAPI field
name for representing a query filter. However, since 'filter' is a
built-in function, we actually have to use filter_ throughout the code
in order to not override the built-in function....

17385bd2 08/30/2011 02:01 pm Andrea Spadaccini

Fixes to errors/warnings raised by pylint 0.24

Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how I
fixed them:

  • jqueue.py: silenced E1101
  • netutils.py: rewrote the list comprehension using extend()
  • watcher/__init__.py: fixed a missing format string parameter...
b459a848 08/30/2011 11:24 am Andrea Spadaccini

DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst)....

e687ec01 08/25/2011 01:53 pm Michael Hanselmann

PEP8 style fixes

Identified using the “pep8” utility.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5f01e6ad 08/22/2011 06:46 pm Michael Hanselmann

watcher: Wait for child processes by default

This patch retains the behaviour of ganeti-watcher in previous Ganeti
versions.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5bfb1134 08/12/2011 03:52 pm Michael Hanselmann

watcher: Use locks when querying for resource information

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

6f9e71bb 08/05/2011 04:40 pm Michael Hanselmann

watcher: Fix breakage caused by 9bb69bb52fb9

The first argument to str.split is the separator, not the maximum number
of splits.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

9bb69bb5 08/05/2011 02:06 pm Michael Hanselmann

watcher: Write per-group instance status, merge into global one

Each per-group watcher process writes its own instance status file. Once
that's done it tries to acquire an exclusive lock on the global file and
will proceed to read all status file, merging them based on each file's...

16e0b9c9 08/04/2011 01:28 pm Michael Hanselmann

ganeti-watcher: Split for node groups

This patch brings a huge change to ganeti-watcher to make it aware of
node groups. Each node group is processed in its own subprocess,
reducing the impact of long-running operations.

The global watcher state file, $datadir/ganeti/watcher.data, is replaced...

d66bbe9f 08/02/2011 11:20 am Iustin Pop

Fix doclint failures

Commit 54ca6e4b2 renamed some arguments, but didn't also renames them
in the docstrings.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

8f07dc0d 07/29/2011 06:02 pm Michael Hanselmann

watcher: Separate function for writing instance status file

For now this will do another query to the master daemon, but with the
split for node groups this issue will go away.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

d7c42723 07/29/2011 06:02 pm Michael Hanselmann

watcher: Make RAPI error messages less technical

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

54ca6e4b 07/29/2011 06:02 pm Michael Hanselmann

watcher.state: Use strings, not objects

Until now the state class would receive instances as objects
(ganeti.watcher.Instance), but this is not necessary. By using strings
the interface is simplified.

This patch also simplifies some code accessing the internal structures,...

013ce4ae 07/29/2011 06:02 pm Michael Hanselmann

watcher: Raise error on unknown hook status

Also, remove punctuation from one error message.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

0cc9e018 07/29/2011 06:01 pm Michael Hanselmann

watcher: Reformat constants

Make them match with style guide.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

adf6301e 07/29/2011 11:48 am Michael Hanselmann

watcher: Split state class into separate module

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

bcf0450d 07/29/2011 11:21 am Michael Hanselmann

Rename watcher's constant for instance status file

“upfile” is a bad name.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

9ca87fb3 07/28/2011 04:27 pm Michael Hanselmann

watcher: Split node maintenance into separate module

The node maintenance class is standalone.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ae1a845c 07/26/2011 01:53 pm Michael Hanselmann

Change OpClusterVerifyDisks to per-group opcodes

Until now verifying disks, which is also used by the watcher,
would lock all nodes and instances. With this patch the opcode
is changed to operate on per nodegroup, requiring fewer locks.

Both “gnt-cluster” and “ganeti-watcher” are changed for the...

580c971e 04/29/2011 03:38 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4: (24 commits)
    mlock: fail gracefully if libc.so.6 cannot be loaded
    Allow creating the DRBD metadev in a different VG
    Make _GenerateDRBD8Branch accept different VG names
    Fix WriteFile with unicode data
    Replace disks: keep the meta device in the same VG...
a0aa6b49 04/19/2011 03:38 pm Michael Hanselmann

Fix bug in watcher

If “utils.RunParts” were to raise an exception, a log message was
written and the code continued to run. Due to the exception the
“results” variable would not be defined.

Also change the code to log a backtrace (getting an exception is rather...

af7b6689 04/07/2011 01:24 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4:
    LUInstanceQueryData: Don't acquire locks unless requested
    Increase the lock timeouts before we block-acquire
    daemon.py: move startup log message before prep_fn
    Display the actual memory values in N+1 failures...
604c175c 03/24/2011 06:17 pm Iustin Pop

watcher: improve logging a bit

Add some debug logging to detail why we don't run some steps.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

f0a80b01 03/17/2011 06:39 pm Michael Hanselmann

watcher: Fix misleading usage output

When “ganeti-watcher” is called with an argument, it would hint at
a non-existing “-f” parameter. With this patch the separate usage
string is no longer necessary.

Signed-off-by: Michael Hanselmann <>...

61a980a9 02/23/2011 03:52 pm Michael Hanselmann

Add constants for instance status

They've been hardcoded for too long.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

cfcc79c6 02/02/2011 06:02 pm Michael Hanselmann

utils.SetupLogging: Make program a mandatory argument

It's passed in by most users (daemons, CLI scripts) and for the others
(burnin, watcher) it certainly doesn't hurt, especially when using
syslog.

Signed-off-by: Michael Hanselmann <>...

83e5e26f 01/27/2011 01:01 pm René Nussbaumer

Watcher: Fix endless repair tries for broken secondary

In cases where secondary was offline and not evacuated watcher tried
to activate-disks in an endless manner, but this is useless, as the
secondary is offline and therefore not responding to this approach....

c873d91c 01/18/2011 01:47 pm Iustin Pop

Rename OpStartupInstance and LUStartupInstance

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

2237687b 01/18/2011 01:47 pm Iustin Pop

Rename OpQueryNodes and LUQueryNodes

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

f2af0bec 01/18/2011 01:47 pm Iustin Pop

Rename OpQueryInstances and LUQueryInstances

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

bd8210a7 01/18/2011 01:47 pm Iustin Pop

Rename OpVerifyDisks and LUVerifyDisks

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

83f5d475 01/18/2011 01:47 pm Iustin Pop

Rename OpActivateInstanceDisks and LUActivateInstanceDisks

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

9f4bb951 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-watcher to ganeti.watcher

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>