Print delete errors to stderr

Sending errors to stderr is just the right thing to do.
And, in addition, it's consistent with the existing code
in manilaclient/client.py:main().

Change-Id: Ib482fe8b29d3ab9f1af6a23b2ab54aea6e9e88bc
This commit is contained in:
Pete Zaitcev 2014-08-13 15:28:52 -06:00
parent 9c2269c803
commit aecd7b4f90
1 changed files with 4 additions and 2 deletions

View File

@ -441,7 +441,8 @@ def do_delete(cs, args):
share_ref.delete()
except Exception as e:
failure_count += 1
print("Delete for share %s failed: %s" % (share, e))
print("Delete for share %s failed: %s" % (share, e),
file=sys.stderr)
if failure_count == len(args.share):
raise exceptions.CommandError("Unable to delete any of the specified "
@ -461,7 +462,8 @@ def do_force_delete(cs, args):
_find_share(cs, share).force_delete()
except Exception as e:
failure_count += 1
print("Delete for share %s failed: %s" % (share, e))
print("Delete for share %s failed: %s" % (share, e),
file=sys.stderr)
if failure_count == len(args.share):
raise exceptions.CommandError("Unable to force delete any of "
"specified shares.")