export: add meaningful exit code
authorIustin Pop <iustin@google.com>
Wed, 5 Aug 2009 11:02:48 +0000 (13:02 +0200)
committerIustin Pop <iustin@google.com>
Wed, 5 Aug 2009 11:19:25 +0000 (13:19 +0200)
commit084f05a5176cb3ea47e5f5b7f711ace5b8bdef07
tree12254006d0472f6401f375b24be813712999ae7c
parenta48b08bf239a7479497265ddb586daa677b0edc1
export: add meaningful exit code

Currently ‘gnt-backup export’ always returns exit code zero, even in the
face of complete failure during backup (only failure to stop/start the
instance will cause job failure and thus non-zero exit code). This is
bad, since one cannot script the backup.

This patch adds some simple results from the LU so that the command line
script can return good exit code. It will:
  - return zero for full success (snapshot removal errors are ignored
    though)
  - return one for full failure (finalize export failure or all disks
    failure)
  - return two for partial failure (some disks backed up, some not)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/cmdlib.py
man/gnt-backup.sgml
scripts/gnt-backup