diff options
author | Ivan Kolodyazhny <e0ne@e0ne.info> | 2017-03-14 18:01:06 +0200 |
---|---|---|
committer | Ivan Kolodyazhny <e0ne@e0ne.info> | 2017-03-14 22:40:27 +0200 |
commit | 152bff4df921fb64c9e455fd0fbee0350e75a713 (patch) | |
tree | 3586fc0db6150ff5b1f9a874a42a19f77c4f7566 /cinderclient/v3/shell.py | |
parent | 3b60eba9aa022a5f5a7b84ce236626f31493485b (diff) | |
download | python-cinderclient-152bff4df921fb64c9e455fd0fbee0350e75a713.tar.gz |
Fix service-list command for API v.3.0-3.6
Commit I90a2b713556e91db69270a03ef6b798e08f93f90 introduced an issue
with service-list command. It was broken for version from 3.0 to 3.6
Change-Id: I0febcb5debdbe157febfd1d1796e716897bde33d
Closes-Bug: #1672705
Diffstat (limited to 'cinderclient/v3/shell.py')
-rw-r--r-- | cinderclient/v3/shell.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index 899bcaa..383e9fb 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -1021,7 +1021,7 @@ def do_group_snapshot_delete(cs, args): "group snapshots.") -@api_versions.wraps('3.7') +@api_versions.wraps('3.0') @utils.arg('--host', metavar='<hostname>', default=None, help='Host name. Default=None.') @utils.arg('--binary', metavar='<binary>', default=None, @@ -1031,12 +1031,17 @@ def do_group_snapshot_delete(cs, args): const=True, nargs='?', default=False, + start_version='3.7', help='Enables or disables display of ' 'Replication info for c-vol services. Default=False.') def do_service_list(cs, args): """Lists all services. Filter by host and service binary.""" - replication = strutils.bool_from_string(args.withreplication, - strict=True) + if hasattr(args, 'withreplication'): + replication = strutils.bool_from_string(args.withreplication, + strict=True) + else: + replication = False + result = cs.services.list(host=args.host, binary=args.binary) columns = ["Binary", "Host", "Zone", "Status", "State", "Updated_at"] if cs.api_version.matches('3.7'): |