From 94456b6617881e21f21668cd123d722bba21c8bd Mon Sep 17 00:00:00 2001 From: Sulochan Acharya Date: Wed, 1 Mar 2017 11:41:35 +0000 Subject: [PATCH] Add filter params to host-list command $craton host-list needs to allow some of the filtering parameters to users to be able to filer host listing. This patch adds --ip, --device-type, --vars and --label parameters as allowed filters to host-list. Closes Bug: 1659235 Change-Id: I663079ca454a3451c2688c518884243da1488b85 --- cratonclient/shell/v1/hosts_shell.py | 24 +++++++ .../integration/shell/v1/test_hosts_shell.py | 52 ++++++++++++++ .../tests/unit/shell/v1/test_hosts_shell.py | 72 +++++++++++++++++++ 3 files changed, 148 insertions(+) diff --git a/cratonclient/shell/v1/hosts_shell.py b/cratonclient/shell/v1/hosts_shell.py index 9e07f12..e33108b 100644 --- a/cratonclient/shell/v1/hosts_shell.py +++ b/cratonclient/shell/v1/hosts_shell.py @@ -76,6 +76,22 @@ def do_host_show(cc, args): metavar='', default=None, help='ID of the cell to use to resume listing hosts.') +@cliutils.arg('--device-type', + metavar='', + default=None, + help='Device type to use as filter.') +@cliutils.arg('--vars', + metavar='', + default=None, + help='Variables to use as filter in the form of key:value.') +@cliutils.arg('--label', + metavar='