ganeti-local
13 years agoShared file storage initialization code
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:04 +0000 (13:51 +0200)]
Shared file storage initialization code

Add shared file storage handling during cluster initialization.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCore shared file storage support
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:03 +0000 (13:51 +0200)]
Core shared file storage support

This patch introduces core file storage support, consisting of the following:

A configure-time switch for enabling/disabling shared file storage
support and controlling the shared file storage location:
--with-shared-file-storage-dir=.  Shared file storage configuration is then
available as _autoconf.ENABLE_SHARED_FILE_STORAGE and
_autoconf.SHARED_FILE_STORAGE_DIR and there is a cluster-wide ssconf
key named "shared_file_storage_dir" for changing the file location.

A new disk template named "sharedfile" (DT_SHARED_FILE), using
ganeti.bdev.FileStorage.

Auxiliary functions in lib/config.py to handle shared file storage.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: small style fixes]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd shared file storage design doc
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:02 +0000 (13:51 +0200)]
Add shared file storage design doc

Add doc/design-shared-storage.rst to document the proposed changes and update
Makefile.am respectively.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Allow use of more complex filters
Michael Hanselmann [Mon, 28 Feb 2011 11:23:08 +0000 (12:23 +0100)]
cmdlib: Allow use of more complex filters

This patch finally enables the use of complex filters through opcodes
and LUXI.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoquery: Add support for filters
Michael Hanselmann [Mon, 28 Feb 2011 11:22:50 +0000 (12:22 +0100)]
query: Add support for filters

This patch adds a “compiler” for query filters, converting them to a
callable function used while preparing the query result. In addition, a
hints call allows some analysis to be done on the query (e.g. referenced
names), making data collection more efficient.

The depth of filters is limited to avoid exceeding the runtime's maximum
recursion depth.

More operators and other improvements can be implemented using this
base. Extensive unittests are provided.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoAdd query field flags
Michael Hanselmann [Fri, 25 Feb 2011 14:27:32 +0000 (15:27 +0100)]
Add query field flags

Some fields (e.g. “name”) should be treated specially when comparing for
equality. Hypervisor names should use normal rules, but for node names,
“node2” should be equivalent with “node2.example.com”.

To make these differences, a new field for flags is added to the query
fields. It is not added to ”objects.QueryFieldDefinition” (the first
item) as it would be exported to clients, something not desired for
these internal rules. Instead, an additional field is added.

Other special rules, e.g. “a list of strings” for an instance's
secondary nodes, can be implemented as flags, too.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoqlang: Add new operators
Michael Hanselmann [Fri, 25 Feb 2011 11:42:30 +0000 (12:42 +0100)]
qlang: Add new operators

These are only used programmatically, not exposed to the user.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agognt-cluster master-failover: Undrain queue
Michael Hanselmann [Mon, 28 Feb 2011 15:15:09 +0000 (16:15 +0100)]
gnt-cluster master-failover: Undrain queue

- Move functions for drain status (tracked via file) from jqueue to jstore
- Undrain queue on master failover if necessary
- Add QA test

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

13 years agoQuery: Add additional test to node.powered for OOB handling
René Nussbaumer [Fri, 25 Feb 2011 13:42:19 +0000 (14:42 +0100)]
Query: Add additional test to node.powered for OOB handling

This patch covers the testing of _GetNodePower of query.py not only for
unavailable but also for OOB support and returning the right
node.powered.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agognt-* list-fields: Show field description
Michael Hanselmann [Fri, 25 Feb 2011 13:13:16 +0000 (14:13 +0100)]
gnt-* list-fields: Show field description

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agognt-instance reboot start instance if not yet started
René Nussbaumer [Thu, 24 Feb 2011 13:32:21 +0000 (14:32 +0100)]
gnt-instance reboot start instance if not yet started

This patch starts the instance when gnt-instance reboot is invoked on a
instance already stopped.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUpdate the DD of OOB with gnt-cluster epo
René Nussbaumer [Tue, 15 Feb 2011 10:16:19 +0000 (11:16 +0100)]
Update the DD of OOB with gnt-cluster epo

This command came up in a local discussion about how much logic we
should put into gnt-node power off. We decided to go with a separate
convenience command which takes care of all the steps through the
procedures to turn down the cluster into a state suitable for a shutdown
of the underlying machine.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoutils: Export NiceSortKey function
Michael Hanselmann [Thu, 24 Feb 2011 18:20:13 +0000 (19:20 +0100)]
utils: Export NiceSortKey function

The ability to split a string into a list of strings and integers can be
handy elsewhere and is necessary for sorting query results by names.

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

13 years agoFix test output splattering
René Nussbaumer [Thu, 24 Feb 2011 13:51:13 +0000 (14:51 +0100)]
Fix test output splattering

Instead of hardcode to ToStdout in the helper class, we should use
a user provided feedback function. In unittests this is a noop.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoGenerate query fields in man pages
Michael Hanselmann [Thu, 24 Feb 2011 11:58:52 +0000 (12:58 +0100)]
Generate query fields in man pages

This patch replaces the hand-written lists of fields, sometimes
incomplete, wrong or inconsistent, with generated ones. What's not very
nice yet is the representation for numbered lists (“nic.ip/0: IP address
of 1st network interface”, “nic.ip/1: IP address of 2nd network
interface”, etc.), but some kind of grouping can be done later.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoAdd script to generate query fields documentation
Michael Hanselmann [Wed, 23 Feb 2011 17:05:22 +0000 (18:05 +0100)]
Add script to generate query fields documentation

- All lines matching "@QUERY_FIELDS_${resource}@" in the input will be
  replaced with a definition list describing the fields for $resource
- The core code is kept in the Sphinx extension, so that it could be
  used from there, too

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoAdd query field descriptions
Michael Hanselmann [Wed, 23 Feb 2011 13:58:47 +0000 (14:58 +0100)]
Add query field descriptions

- Make “doc” parameter to MakeField non-optional
- Add descriptions for all fields

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoquery: Add support for field description
Michael Hanselmann [Tue, 22 Feb 2011 14:18:48 +0000 (15:18 +0100)]
query: Add support for field description

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoAdd function to format ordinals
Michael Hanselmann [Tue, 22 Feb 2011 17:58:38 +0000 (18:58 +0100)]
Add function to format ordinals

See [1] for the rules.

[1] http://en.wikipedia.org/wiki/Names_of_numbers_in_English#Ordinal_numbers

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoIntroducing gnt-cluster epo
René Nussbaumer [Wed, 16 Feb 2011 10:05:56 +0000 (11:05 +0100)]
Introducing gnt-cluster epo

This is a convenience command to do an automated EPO in the possible limits of
Ganeti.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMove OOB_TIMEOUT_OPT to cli.py
René Nussbaumer [Wed, 16 Feb 2011 12:09:00 +0000 (13:09 +0100)]
Move OOB_TIMEOUT_OPT to cli.py

OOB commands where we need to be able to specify the timeout are
enhancing over the border of just gnt-node so we move it into cli.py
for easy reuse in other cli parts.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoepydoc.conf: Avoid newlines, rebuild if necessary
Michael Hanselmann [Wed, 23 Feb 2011 16:13:38 +0000 (17:13 +0100)]
epydoc.conf: Avoid newlines, rebuild if necessary

Using $(strip …) ensures there won't be any newlines in the value.

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

13 years agoAdd constants for node roles
Michael Hanselmann [Wed, 23 Feb 2011 17:04:48 +0000 (18:04 +0100)]
Add constants for node roles

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

13 years agoAdd constants for instance status
Michael Hanselmann [Wed, 23 Feb 2011 13:39:08 +0000 (14:39 +0100)]
Add constants for instance status

They've been hardcoded for too long.

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

13 years agoMerge remote branch 'devel-2.4'
René Nussbaumer [Wed, 23 Feb 2011 13:29:00 +0000 (14:29 +0100)]
Merge remote branch 'devel-2.4'

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoquery_unittest: Fix argument to set()
René Nussbaumer [Wed, 23 Feb 2011 13:16:12 +0000 (14:16 +0100)]
query_unittest: Fix argument to set()

Commit e431074f introduced an uncatched bug. This patch fixes this. The
set is expecting a list or iteratable to work on, so it splitted the
provided instance name into a set of characters. This caused the
exp_status never been set and therefore not catched in one assert rule
further below who checks that every status was tested.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoquery: Use aliases for legacy instance NIC fields
Michael Hanselmann [Tue, 22 Feb 2011 18:02:28 +0000 (19:02 +0100)]
query: Use aliases for legacy instance NIC fields

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

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Wed, 23 Feb 2011 12:25:09 +0000 (13:25 +0100)]
Merge branch 'devel-2.4'

* devel-2.4:
  Fix title of query field containing instance name

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

13 years agoAdd unittest for cli.FormatResultError
Michael Hanselmann [Tue, 22 Feb 2011 17:00:56 +0000 (18:00 +0100)]
Add unittest for cli.FormatResultError

Also make the parameter for verbosity mandatory.

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

13 years agoFix title of query field containing instance name
Michael Hanselmann [Tue, 22 Feb 2011 17:17:57 +0000 (18:17 +0100)]
Fix title of query field containing instance name

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

13 years agocmdlib: Fix pylint error
Michael Hanselmann [Tue, 22 Feb 2011 17:14:22 +0000 (18:14 +0100)]
cmdlib: Fix pylint error

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

13 years agocmdlib: Use filters internally for queries
Michael Hanselmann [Tue, 15 Feb 2011 18:52:25 +0000 (19:52 +0100)]
cmdlib: Use filters internally for queries

This is in preparation for implementing real query filters.

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

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Tue, 22 Feb 2011 15:36:44 +0000 (16:36 +0100)]
Merge branch 'devel-2.4'

* devel-2.4: (60 commits)
  Update news and bump version for 2.4.0 rc2
  Fix pylint warnings
  TestRapiInstanceRename use instance name
  Change the list formatting to a 'special' chars
  Add support for merging node groups
  Add option to rename groups on conflict
  Fix minor docstring typo
  Add QA rapi test for instance reinstall
  RAPI: remove required parameters for reinstall
  Fix HV/OS parameter validation on non-vm nodes
  NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
  NodeQuery: don't query non-vm_capable nodes
  Fix LUClusterRepairDiskSizes and rpc result usage
  Fix RPC mismatch in blockdev_getsize[s]
  Remove superfluous redundant requirement
  Don't remove master_candidate flag from merged nodes
  Use a consistent ECID base
  listrunner: convert from getopt to optparse
  listrunner: fix agent usage
  Revert "Disable the cluster-merge tool for the moment"
  ...

Conflicts:
NEWS: Trivial
lib/cli.py: Dropped _RSTATUS_TO_TEXT from master and used
    RSS_DESCRIPTION from devel-2.4 instead, adjusted users accordingly

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

13 years agoAdd/rename label for LUXI in documentation
Michael Hanselmann [Mon, 21 Feb 2011 15:51:42 +0000 (16:51 +0100)]
Add/rename label for LUXI in documentation

The HTTP server design doc will refer to the LUXI protocol,
so conflicts need to be avoided.

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

13 years agoUpdate news and bump version for 2.4.0 rc2 v2.4.0rc2
Iustin Pop [Mon, 21 Feb 2011 10:28:00 +0000 (11:28 +0100)]
Update news and bump version for 2.4.0 rc2

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoMerge branch 'devel-2.4' into stable-2.4
Iustin Pop [Mon, 21 Feb 2011 09:36:10 +0000 (10:36 +0100)]
Merge branch 'devel-2.4' into stable-2.4

* devel-2.4: (23 commits)
  Fix pylint warnings
  Change the list formatting to a 'special' chars
  Add support for merging node groups
  Add option to rename groups on conflict
  Fix minor docstring typo
  Fix HV/OS parameter validation on non-vm nodes
  NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
  NodeQuery: don't query non-vm_capable nodes
  Remove superfluous redundant requirement
  Don't remove master_candidate flag from merged nodes
  Use a consistent ECID base
  listrunner: convert from getopt to optparse
  listrunner: fix agent usage
  Revert "Disable the cluster-merge tool for the moment"
  Fix cluster-merging by not stopping noded
  Fix error msg for instances on offline nodes
  Minor reordering to match param order
  cluster verify and instance disks on offline nodes
  Cluster verify and N+1 warnings for offline nodes
  Handle gnt-instance shutdown --all for empty clusters
  Use gnt-node add --force-join to add foreign nodes
  Add --force-join option to gnt-node add
  Fix iterating over node groups

Of the above commits present in the devel-2.4 branch, only the “Add
--force-join option to gnt-node add” is a potential issue, but this
has been QA-ed successfully. The other fixes are split in three
groups:

- non-core changes (cluster-merge, listrunner)
- trivial fixes (docstrings, etc.)
- bugs that we want fixed

As such, instead of cherry-picking only individual patches, I propose
that we unify stable and devel 2.4 and make a new RC out of the
result.

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

13 years agoFix pylint warnings
Stephen Shirley [Fri, 18 Feb 2011 15:25:59 +0000 (16:25 +0100)]
Fix pylint warnings

- 1 80-char line infraction
- 4 changes in how arguments are passed to logging functions
- 3 pylint disable-msg's because cluster-merge needs to access ganeti
  config internals

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoTestRapiInstanceRename use instance name
Guido Trotter [Fri, 18 Feb 2011 12:52:58 +0000 (12:52 +0000)]
TestRapiInstanceRename use instance name

Currently the QA rename job wrongly passed the whole info dict to the
client.

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

13 years agoChange the list formatting to a 'special' chars
Iustin Pop [Fri, 18 Feb 2011 12:51:03 +0000 (13:51 +0100)]
Change the list formatting to a 'special' chars

And also enable verbose display via the, well, verbose option. Man
page and tests are updated, and the formatting is moved from 4 if
statements to a data structure.

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

13 years agoAdd support for merging node groups
Stephen Shirley [Fri, 18 Feb 2011 12:59:46 +0000 (13:59 +0100)]
Add support for merging node groups

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdd option to rename groups on conflict
Stephen Shirley [Fri, 18 Feb 2011 12:30:37 +0000 (13:30 +0100)]
Add option to rename groups on conflict

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix minor docstring typo
Stephen Shirley [Thu, 17 Feb 2011 16:00:24 +0000 (17:00 +0100)]
Fix minor docstring typo

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd QA rapi test for instance reinstall
Guido Trotter [Fri, 18 Feb 2011 11:33:09 +0000 (11:33 +0000)]
Add QA rapi test for instance reinstall

This tests at least the basic case, unfortunately there is no way to
check all possibilities using the provided rapi client, as that will use
the new method unless the cluster doesn't support it.

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

13 years agoRAPI: remove required parameters for reinstall
Guido Trotter [Fri, 18 Feb 2011 11:20:01 +0000 (11:20 +0000)]
RAPI: remove required parameters for reinstall

Before c744425f354f1bef2d0d7d306e2d00c494d67d2b instance reinstall
accepted the "os" and "nostartup" optional query parameters. With that
commit it was changed to allow "os" "start" and "osparams" via body
rather than encoded in the URL. Unfortunately that commit introduced a
bug, which required the "os" parameter to be passed for body requests,
and at least one of "os" or "nostartup" for query request.

This fix makes sure all parameters are optional again.

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

13 years agoFix HV/OS parameter validation on non-vm nodes
Iustin Pop [Thu, 17 Feb 2011 16:06:59 +0000 (17:06 +0100)]
Fix HV/OS parameter validation on non-vm nodes

Currently, there is at least one LU that does wrong validation of HV
parameters (against all nodes, LUClusterSetParams). It's possible to
fix this case, but I went and modified the base functions to filter
out non-vm_capable nodes so all callers are protected.

Note: the _CheckOSParams function is never called with all nodes list,
so modifying it shouldn't be needed. However, I think it's safe to do
so (and it shouldn't hurt as an instance's node shouldn't ever lack
the vm_capable bit).

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

13 years agoNodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
Iustin Pop [Thu, 17 Feb 2011 13:42:57 +0000 (14:42 +0100)]
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes

Since we don't have the data per design, UNAVAIL is appropriate here,
while NODATA is not.

The patch also adds a comment: if we extend the live fields list to
contain other data in the future, we need to reevaluate this solution.

This should fix issue 143. The listing now shows (node2==ofline,
node3==not vm_capable):

  Node     DTotal     DFree    MTotal     MNode     MFree Pinst Sinst
  node1    698.6G    630.5G     32.0G      1.0G     30.0G     8     7
  node2 (offline) (offline) (offline) (offline) (offline)     9     4
  node3 (unavail) (unavail) (unavail) (unavail) (unavail)     0     0

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

13 years agoNodeQuery: don't query non-vm_capable nodes
Iustin Pop [Thu, 17 Feb 2011 13:41:29 +0000 (14:41 +0100)]
NodeQuery: don't query non-vm_capable nodes

Because non-vm_capable nodes most likely don't have a hypervisor
configured and/or storage, so the call will fail anyway.

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

13 years agoFix LUClusterRepairDiskSizes and rpc result usage
Iustin Pop [Tue, 15 Feb 2011 13:39:44 +0000 (14:39 +0100)]
Fix LUClusterRepairDiskSizes and rpc result usage

This LU was introduced before the RPC result conversion from .data to
.payload, and it has managed to keep the old-style usage (how? it's
the only LU that does so). Fix by changing to payload, and add some
extra logging for easier diagnose.

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

13 years agoFix RPC mismatch in blockdev_getsize[s]
Iustin Pop [Tue, 15 Feb 2011 13:29:08 +0000 (14:29 +0100)]
Fix RPC mismatch in blockdev_getsize[s]

Commit 92fd2250 added consistency checks in the RPC layer, which broke
the call_blockdev_getsizes RPC call (declared with 's' at the end in
rpc.py, without 's' in the node daemon).

The immediate fix is to correct the rpc function name, the long term
one will be to remove this duplication.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>

13 years agoRephrase a misleading pydoc for netutils.TcpPing
René Nussbaumer [Thu, 17 Feb 2011 11:51:36 +0000 (12:51 +0100)]
Rephrase a misleading pydoc for netutils.TcpPing

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>

13 years agoRemove superfluous redundant requirement
Stephen Shirley [Tue, 15 Feb 2011 16:40:54 +0000 (17:40 +0100)]
Remove superfluous redundant requirement

The condition is already covered by the previous requirement.

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoDon't remove master_candidate flag from merged nodes
Stephen Shirley [Tue, 15 Feb 2011 14:29:03 +0000 (15:29 +0100)]
Don't remove master_candidate flag from merged nodes

Prevents lots of spurious warnings like:
2011-02-10 17:00:22,776: CRITICAL Configuration data is not consistent:
Not enough master candidates: actual 3, target 4

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse a consistent ECID base
Stephen Shirley [Tue, 15 Feb 2011 14:06:03 +0000 (15:06 +0100)]
Use a consistent ECID base

ECID was being calculated completely differently in
__MergeNodeGroups() and _MergeConfig()

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agolistrunner: convert from getopt to optparse
Iustin Pop [Wed, 16 Feb 2011 16:21:03 +0000 (17:21 +0100)]
listrunner: convert from getopt to optparse

The “-A” (use agent) was not documented, and instead of adding manual
listing, I converted it to optparse like the other CLI tools.

Note that I cleaned up a bit the usage and help texts.

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

13 years agolistrunner: fix agent usage
Iustin Pop [Wed, 16 Feb 2011 12:32:29 +0000 (13:32 +0100)]
listrunner: fix agent usage

By delaying the agent key query until after the fork, we prevent the
problem of simultaneous access to the agent.

Tested that it works against 80 hosts in parallel without error; the
current version breaks already at 20 hosts.

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

13 years agoFix build error when using docutils 0.4
Michael Hanselmann [Wed, 16 Feb 2011 11:50:35 +0000 (12:50 +0100)]
Fix build error when using docutils 0.4

Docutils 0.4 doesn't provide the “Directive” class and Sphinx supplies
its own version which doesn't have the “assert_has_content” method.

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

13 years agoAdding more details to gnt-node man-page
René Nussbaumer [Thu, 3 Feb 2011 12:07:54 +0000 (13:07 +0100)]
Adding more details to gnt-node man-page

This adds some recently added flags to the man-page of gnt-node command.
It also describes their purpose and handling.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRemove force_master support from LUOobCommand
René Nussbaumer [Thu, 3 Feb 2011 12:57:56 +0000 (13:57 +0100)]
Remove force_master support from LUOobCommand

As per discussion on the man-page[1] update, this functionality should be
removed and replaced by just give the command to run if the user insists
of power cycle/power off the master and refuse to operate.

[1] http://groups.google.com/group/ganeti-devel/browse_thread/thread/95d4879a747cc295

This also removes the --all flag from gnt-node power because it was
buggy and would have added too much logic for special cases.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd pylint disables to Sphinx extension
Michael Hanselmann [Tue, 15 Feb 2011 13:35:00 +0000 (14:35 +0100)]
Add pylint disables to Sphinx extension

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

13 years agoRAPI documentation: Use constants and assertions
Michael Hanselmann [Tue, 15 Feb 2011 12:36:09 +0000 (13:36 +0100)]
RAPI documentation: Use constants and assertions

This doesn't cover everything yet, but it's a good demonstration on how
to use “pyeval” and “pyassert”.

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

13 years agoerrors: Add list of possible failure types
Michael Hanselmann [Tue, 15 Feb 2011 12:35:22 +0000 (13:35 +0100)]
errors: Add list of possible failure types

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

13 years agoSphinx extension: Allow evaluation of Python expressions
Michael Hanselmann [Tue, 15 Feb 2011 12:34:43 +0000 (13:34 +0100)]
Sphinx extension: Allow evaluation of Python expressions

There are quite many hardcoded constants (e.g. “[…] one of ``file``,
``lvm-pv`` or ``lvm-vg`` […]). By using constants it'll be easier to
identify these.

With such lists of values it's also easy to miss some when
extending/changing something. By adding assertions inlined with reST,
these can also be detected.

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

13 years agoSphinx extension: Don't use “from … import …”
Michael Hanselmann [Tue, 15 Feb 2011 12:30:36 +0000 (13:30 +0100)]
Sphinx extension: Don't use “from … import …”

Import with full name instead to reduce potential conflicts.

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

13 years agoRAPI: Remove “__version__” for instance creation
Michael Hanselmann [Tue, 15 Feb 2011 13:01:14 +0000 (14:01 +0100)]
RAPI: Remove “__version__” for instance creation

If left in data, FillOpCode will complain. This fixes the QA breakage
after commit 526a662af.

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

13 years agoRAPI: Use FillOpCode for adding node group
Michael Hanselmann [Mon, 14 Feb 2011 16:30:19 +0000 (17:30 +0100)]
RAPI: Use FillOpCode for adding node group

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRAPI: Use FillOpCode for renaming groups
Michael Hanselmann [Mon, 14 Feb 2011 15:38:15 +0000 (16:38 +0100)]
RAPI: Use FillOpCode for renaming groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoMake OpGroupRename consistent with OpInstanceRename
Michael Hanselmann [Mon, 14 Feb 2011 15:35:13 +0000 (16:35 +0100)]
Make OpGroupRename consistent with OpInstanceRename

OpInstanceRename uses “instance_name” (like almost all other OpInstance*
opcodes), not “old_name”, to specify the original name. OpGroupRename is
made consistent by renaming “old_name” to “group_name”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRAPI: Clean up instance creation, use generated docs
Michael Hanselmann [Mon, 14 Feb 2011 15:14:06 +0000 (16:14 +0100)]
RAPI: Clean up instance creation, use generated docs

- Use FillOpCode and unify parameter names between RAPI and opcode
- Generate parameter documentation
- Improve opcode parameter documentation

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRAPI: Generate documentation for assigning nodes to groups
Michael Hanselmann [Mon, 14 Feb 2011 13:10:18 +0000 (14:10 +0100)]
RAPI: Generate documentation for assigning nodes to groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRAPI: Use FillOpCode for modifying node group
Michael Hanselmann [Mon, 14 Feb 2011 13:09:57 +0000 (14:09 +0100)]
RAPI: Use FillOpCode for modifying node group

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRAPI: Use FillOpCode for renaming instances
Michael Hanselmann [Mon, 14 Feb 2011 12:41:57 +0000 (13:41 +0100)]
RAPI: Use FillOpCode for renaming instances

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agobaserlib.FillOpCode: Allow parameter rename
Michael Hanselmann [Mon, 14 Feb 2011 16:20:33 +0000 (17:20 +0100)]
baserlib.FillOpCode: Allow parameter rename

Some RAPI parameters don't match the name of the underlying
opcode. With this patch they can be renamed while filling
the opcode.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRevert "Disable the cluster-merge tool for the moment"
Stephen Shirley [Thu, 10 Feb 2011 16:32:26 +0000 (17:32 +0100)]
Revert "Disable the cluster-merge tool for the moment"

This reverts commit c0711f2cb989facd60430ab18c5b0e59a1f279ac.

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix cluster-merging by not stopping noded
Stephen Shirley [Thu, 10 Feb 2011 10:52:13 +0000 (11:52 +0100)]
Fix cluster-merging by not stopping noded

cli.RunWhileClusterStopped() stops noded on all of the nodes in the
original cluster. This prevents /etc/hosts updates on the master, and
config redistribution doesn't reach the other nodes in the original
cluster. As all we want to do is merge while the master is stopped,
simply stop it and start it again after.

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix bug in iallocator data structures build
Iustin Pop [Thu, 10 Feb 2011 13:55:08 +0000 (14:55 +0100)]
Fix bug in iallocator data structures build

Commit a1cef11c fixed non-vm_capable nodes export, but broke
inadvertently offline nodes. The update of the dict only needs to
happen for online nodes, in the 'if' block.

Without this patch, offline nodes keep the data from the last node
that was not offline; end result is that all nodes are considered
online (unless the first node is offline, in which case an error will
be raised).

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

13 years agoFix html docs builds
Iustin Pop [Tue, 8 Feb 2011 11:04:11 +0000 (12:04 +0100)]
Fix html docs builds

This fixes the doc builds broken by commit b292b986, but is only an
ugly workaround due to our dependency chain.

opcodes.py imports (both directly and indirectly) constants.py, which
imports _autoconf.py. Hence one could say that all .py files have a
logical dependency on _autoconf.py, since you can't "import opcodes"
before _autoconf.py is built. So the sphinx rule should depend on
_autoconf.py as a prerequisite.

But we can't use a normal prerequisite, since that would cause the
html docs to be rebuilt whenever _autoconf.py gets rebuilt, i.e. even
on end-users machines after ./configure; this is bad, and it also
breaks distcheck (as the html files are not removed in distclean,
since we do want them distributed).

So we only add an order-only prerequisite, which does the right thing
(although our dependency chain is still ugly).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>

13 years agoFix error msg for instances on offline nodes
Iustin Pop [Wed, 9 Feb 2011 09:04:39 +0000 (10:04 +0100)]
Fix error msg for instances on offline nodes

Currently, for both primary and secondary offline nodes, we give the
same message:
- ERROR: instance instance14: instance lives on offline node(s) node3
- ERROR: instance instance15: instance lives on offline node(s) node3
- ERROR: instance instance16: instance lives on offline node(s) node3
- ERROR: instance instance17: instance lives on offline node(s) node3

This is confusing, as an offline primary is in a different category
than a secondary. The patch changes the warnings to have different
error messages:
- ERROR: instance instance14: instance has offline secondary node(s) node3
- ERROR: instance instance15: instance has offline secondary node(s) node3
- ERROR: instance instance16: instance lives on offline node node3
- ERROR: instance instance17: instance lives on offline node node3

Thanks to Alexander Schreiber <als@google.com> for reporting this
issue.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Alexander Schreiber <als@google.com>

13 years agoMinor reordering to match param order
Stephen Shirley [Tue, 8 Feb 2011 16:42:18 +0000 (17:42 +0100)]
Minor reordering to match param order

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocluster verify and instance disks on offline nodes
Iustin Pop [Tue, 8 Feb 2011 16:07:13 +0000 (17:07 +0100)]
cluster verify and instance disks on offline nodes

Currently, cluster-verify says:

- ERROR: instance instance14: couldn't retrieve status for disk/0 on node3: node offline
- ERROR: instance instance14: instance lives on offline node(s) node3
- ERROR: instance instance15: couldn't retrieve status for disk/0 on node3: node offline
- ERROR: instance instance15: instance lives on offline node(s) node3

This is redundant as the “lives on offline node” message should be all we need to
understand the cluster situation.

The patch fixes this and also corrects a very old idiom.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>

13 years agoCluster verify and N+1 warnings for offline nodes
Iustin Pop [Tue, 8 Feb 2011 15:56:23 +0000 (16:56 +0100)]
Cluster verify and N+1 warnings for offline nodes

Currently, cluster verify shows warnings N+1 warnings for offline
nodes having any redundant instances since the memory data that we
have for those nodes is zero, so any instance will trigger the
warning.

As the comment says, we already list secondary instances on offline
nodes, so that warning is enough, and we skip the N+1 one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>

13 years agoHandle gnt-instance shutdown --all for empty clusters
Stephen Shirley [Mon, 7 Feb 2011 15:35:34 +0000 (16:35 +0100)]
Handle gnt-instance shutdown --all for empty clusters

The current code gives:
Failure: prerequisites not met for this operation:
error type: wrong_input, error details:
Selection filter does not match any instances

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRAPI: Use FillOpCode for replacing disks
Michael Hanselmann [Fri, 4 Feb 2011 16:39:47 +0000 (17:39 +0100)]
RAPI: Use FillOpCode for replacing disks

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

13 years agoGenerate parts of RAPI documentation from opcodes
Michael Hanselmann [Thu, 3 Feb 2011 17:50:02 +0000 (18:50 +0100)]
Generate parts of RAPI documentation from opcodes

This replaces hardcoded lists of parameters with automatically generated
ones, making maintenance easier.

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

13 years agoAdd sphinx extension
Michael Hanselmann [Thu, 3 Feb 2011 17:46:19 +0000 (18:46 +0100)]
Add sphinx extension

For now this just registers a single new directive, “opcode_params”,
which can be used to generate opcode parameter documentation.

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

13 years agoAdd opcode parameter descriptions
Michael Hanselmann [Fri, 4 Feb 2011 16:23:55 +0000 (17:23 +0100)]
Add opcode parameter descriptions

These will be used in automatically generated parts of the RAPI
documentation. Not all opcodes are documented so far, but each added
opcode's parameters need to be fully documented (verified by an
assertion).

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

13 years agoopcodes: Prepare addition of parameter descriptions
Michael Hanselmann [Fri, 4 Feb 2011 13:55:28 +0000 (14:55 +0100)]
opcodes: Prepare addition of parameter descriptions

For now they're all set to None, but a following patch will set descriptions.

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

13 years agoht: Add descriptive text representations
Michael Hanselmann [Wed, 2 Feb 2011 15:41:34 +0000 (16:41 +0100)]
ht: Add descriptive text representations

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>

13 years agognt-instance reinstall: display OS changes
Iustin Pop [Fri, 4 Feb 2011 15:46:38 +0000 (16:46 +0100)]
gnt-instance reinstall: display OS changes

Currently, when reinstalling an instance, especially when selecting an
OS interactively, is hard to be sure one has chosen the correct OS.

This patch adds displaying the selected OS. I'm not entirely happy, as
it's not very good English (e.g. keeping the same OS should be "but
keep the same OS", and changing should be "and also change …") but I
didn't find a better handling of all the cases:

node1# gnt-instance reinstall -o lenny-image+default instance1
This will reinstall the instance 'instance1' (and change the OS to
'lenny-image+default') which removes all data. Continue?
y/[n]/?: n

node1# gnt-instance reinstall instance1
This will reinstall the instance 'instance1' (and keep the same OS)
which removes all data. Continue?
y/[n]/?: n

node1# gnt-instance reinstall instance1 instance2
The reinstall will operate on 2 instances.
Note: this will remove *all* data for the below instances! It will
keep the same OS.
Do you want to continue?

node1# gnt-instance reinstall -o lenny-image+default instance1
instance2
The reinstall will operate on 2 instances.
Note: this will remove *all* data for the below instances! It will
change the OS to 'lenny-image+default'.
Do you want to continue?

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

13 years agoAllow passing timeout for oob helper in gnt_node.py
René Nussbaumer [Fri, 4 Feb 2011 13:48:00 +0000 (14:48 +0100)]
Allow passing timeout for oob helper in gnt_node.py

This allow to pass in --oob-timeout to define the timeout before the
out-of-band helper is beeing aborted.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUse gnt-node add --force-join to add foreign nodes
Stephen Shirley [Tue, 1 Feb 2011 15:59:46 +0000 (16:59 +0100)]
Use gnt-node add --force-join to add foreign nodes

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd --force-join option to gnt-node add
Stephen Shirley [Tue, 1 Feb 2011 15:59:45 +0000 (16:59 +0100)]
Add --force-join option to gnt-node add

This is needed so cluster-merge can add nodes from other clusters.

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

13 years agoFix iterating over node groups
Stephen Shirley [Tue, 1 Feb 2011 16:14:18 +0000 (17:14 +0100)]
Fix iterating over node groups

Current line tries to unpack dict incorrectly

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRAPI: Use FillOpCode for modifying instance
Michael Hanselmann [Fri, 4 Feb 2011 12:18:33 +0000 (13:18 +0100)]
RAPI: Use FillOpCode for modifying instance

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

13 years agoRAPI: Use FillOpCode for migrating instance
Michael Hanselmann [Wed, 2 Feb 2011 17:53:04 +0000 (18:53 +0100)]
RAPI: Use FillOpCode for migrating instance

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

13 years agoRAPI: Use FillOpCode for exporting instance
Michael Hanselmann [Wed, 2 Feb 2011 17:40:04 +0000 (18:40 +0100)]
RAPI: Use FillOpCode for exporting instance

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

13 years agoUpdate NEWS file for the 2.4.0 rc1 release v2.4.0rc1
Iustin Pop [Fri, 4 Feb 2011 09:54:05 +0000 (10:54 +0100)]
Update NEWS file for the 2.4.0 rc1 release

Also bump up the version.

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

13 years agoDisable the cluster-merge tool for the moment
Iustin Pop [Fri, 4 Feb 2011 09:58:45 +0000 (10:58 +0100)]
Disable the cluster-merge tool for the moment

Hopefully this can be fixed before the final 2.4 release…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>

13 years agoBump up intra-cluster import connect timeout
Iustin Pop [Thu, 3 Feb 2011 15:19:52 +0000 (16:19 +0100)]
Bump up intra-cluster import connect timeout

Currently, the export timeout is 10 times 20 seconds, but the import
is only 30 seconds. I'm raising this to 60 seconds with two goals in
mind:

- when debugging manually, this allows for easier synchronisation of
  the processes
- 60 equals to 3 full 20 second intervals, which I think is better
  than just one an a half

This change shouldn't make a big difference either way (at most, it
will possibly delay the job in case of failures by half a minute).

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

13 years agoImport-export: fix logging of daemon output
Iustin Pop [Thu, 3 Feb 2011 13:17:58 +0000 (14:17 +0100)]
Import-export: fix logging of daemon output

In case of failures, the recent daemon output is logged as %r on a
list of unicode strings, which results in the (ugly):

Thu Feb  3 05:13:34 2011 snapshot/0 failed to send data: Exited with status 1 (recent output: [u'  DUMP: Date of this level 0 dump: Thu Feb  3 05:13:18 2011', u'  DUMP: Dumping /dev/mapper/6369a5f7-1e67-4d0d-a4f0-956b3649c6d7.disk0_data.snap-1 (an unlisted file system) to standard output', u'  DUMP: Label: none', u'  DUMP: Writing 10 Kilobyte records', u'  DUMP: mapping (Pass I) [regular files]', u'  DUMP: mapping (Pass II) [directories]', u'  DUMP: estimated 54301 blocks.', u'  DUMP: Volume 1 started with block 1 at: Thu Feb  3 05:13:19 2011', u'  DUMP: dumping (Pass III) [directories]', u'  DUMP: dumping (Pass IV) [regular files]', u'socat: E SSL_write(): Connection reset by peer', u"dd: dd: writing `standard output': Broken pipe", u'  DUMP: Broken pipe', u'  DUMP: The ENTIRE dump is aborted.'])

This patch joins this list and makes it a non-unicode string, thus
resulting in the more readable (and ~10% shorter):

Thu Feb  3 05:16:04 2011 snapshot/0 failed to send data: Exited with status 1 (recent output:   DUMP: Date of this level 0 dump: Thu Feb  3 05:15:58 2011\n  DUMP: Dumping /dev/mapper/6369a5f7-1e67-4d0d-a4f0-956b3649c6d7.disk0_data.snap-1 (an unlisted file system) to standard output\n  DUMP: Label: none\n  DUMP: Writing 10 Kilobyte records\n  DUMP: mapping (Pass I) [regular files]\n  DUMP: mapping (Pass II) [directories]\n  DUMP: estimated 54350 blocks.\n  DUMP: Volume 1 started with block 1 at: Thu Feb  3 05:15:59 2011\n  DUMP: dumping (Pass III) [directories]\nsocat: E SSL_write(): Connection reset by peer\ndd: dd: writing `standard output': Broken pipe\n  DUMP: Broken pipe\n  DUMP: The ENTIRE dump is aborted.)

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

13 years agoFix handling of ^C in the CLI scripts
Iustin Pop [Thu, 3 Feb 2011 10:02:20 +0000 (11:02 +0100)]
Fix handling of ^C in the CLI scripts

This adds a message and nice handling of ^C, especially useful for
``gnt-job watch``.

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