From 98e0933ca84570b685dcd237cdf35ac3534b5621 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Fri, 28 Jul 2017 17:17:36 -0400 Subject: [PATCH] Fix list command when not given search_opts Can't pop values out of None. Change-Id: I2c62d8bcae4cc4d035fa2bb3aadffb0e1d190751 Closes-Bug: #1707303 --- manilaclient/v2/shares.py | 1 + ...t-command-when-not-given-search-opts-c06af7b344e9cb91.yaml | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 releasenotes/notes/bug-1707303-fix-list-command-when-not-given-search-opts-c06af7b344e9cb91.yaml diff --git a/manilaclient/v2/shares.py b/manilaclient/v2/shares.py index 26bda0f13..4d8479c3b 100644 --- a/manilaclient/v2/shares.py +++ b/manilaclient/v2/shares.py @@ -325,6 +325,7 @@ class ShareManager(base.ManagerWithFind): def list(self, detailed=True, search_opts=None, sort_key=None, sort_dir=None): """Get a list of all shares.""" + search_opts = search_opts or {} search_opts.pop("export_location", None) return self.do_list(detailed=detailed, search_opts=search_opts, sort_key=sort_key, sort_dir=sort_dir) diff --git a/releasenotes/notes/bug-1707303-fix-list-command-when-not-given-search-opts-c06af7b344e9cb91.yaml b/releasenotes/notes/bug-1707303-fix-list-command-when-not-given-search-opts-c06af7b344e9cb91.yaml new file mode 100644 index 000000000..c80cdaaad --- /dev/null +++ b/releasenotes/notes/bug-1707303-fix-list-command-when-not-given-search-opts-c06af7b344e9cb91.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - The list command for --os-share-api-version <=2.34 has been fixed to not + error out in case there are no search options/filters specified.