Comment 1 for bug 1822815

Revision history for this message
Tom Barron (tpb) wrote :

maybe we can do something along these lines ...

diff --git a/manilaclient/v2/shell.py b/manilaclient/v2/shell.py
index 0a5646c..1a3c20d 100644
--- a/manilaclient/v2/shell.py
+++ b/manilaclient/v2/shell.py
@@ -1931,10 +1931,13 @@ def do_list(cs, args):
     total_count = 0
     if strutils.bool_from_string(args.count, strict=True):
         search_opts['with_count'] = args.count
- shares, total_count = cs.shares.list(
- search_opts=search_opts, sort_key=args.sort_key,
- sort_dir=args.sort_dir,
- )
+ try:
+ shares, total_count = cs.shares.list(
+ search_opts=search_opts, sort_key=args.sort_key,
+ sort_dir=args.sort_dir,
+ )
+ except ValueError:
+ shares, total_count = [], 0
     else:
         shares = cs.shares.list(
             search_opts=search_opts, sort_key=args.sort_key,