summaryrefslogtreecommitdiff
path: root/openstackclient/volume
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-01 00:27:11 +0000
committerGerrit Code Review <review@openstack.org>2015-12-01 00:27:11 +0000
commitfcc1c0d68a6a0f56ecc580d87bc70946293605d5 (patch)
treecbfa3989956b1e2eb52f6117708e7290b411246d /openstackclient/volume
parente6057f088b71ec197e444fe4ab570cc0a7c35f35 (diff)
parent9168373b3d7502f0ebe7bca9097ee474bb8d6c5b (diff)
downloadpython-openstackclient-fcc1c0d68a6a0f56ecc580d87bc70946293605d5.tar.gz
Merge "Consistency of the --all argument for snapshots"
Diffstat (limited to 'openstackclient/volume')
-rw-r--r--openstackclient/volume/v1/snapshot.py13
-rw-r--r--openstackclient/volume/v2/snapshot.py13
2 files changed, 24 insertions, 2 deletions
diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v1/snapshot.py
index de7bb5b9..93e17eb8 100644
--- a/openstackclient/volume/v1/snapshot.py
+++ b/openstackclient/volume/v1/snapshot.py
@@ -111,6 +111,12 @@ class ListSnapshot(lister.Lister):
def get_parser(self, prog_name):
parser = super(ListSnapshot, self).get_parser(prog_name)
parser.add_argument(
+ '--all-projects',
+ action='store_true',
+ default=False,
+ help='Include all projects (admin only)',
+ )
+ parser.add_argument(
'--long',
action='store_true',
default=False,
@@ -157,7 +163,12 @@ class ListSnapshot(lister.Lister):
# Just forget it if there's any trouble
pass
- data = self.app.client_manager.volume.volume_snapshots.list()
+ search_opts = {
+ 'all_tenants': parsed_args.all_projects,
+ }
+
+ data = self.app.client_manager.volume.volume_snapshots.list(
+ search_opts=search_opts)
return (column_headers,
(utils.get_item_properties(
s, columns,
diff --git a/openstackclient/volume/v2/snapshot.py b/openstackclient/volume/v2/snapshot.py
index bbc92c48..aa7630ae 100644
--- a/openstackclient/volume/v2/snapshot.py
+++ b/openstackclient/volume/v2/snapshot.py
@@ -108,6 +108,12 @@ class ListSnapshot(lister.Lister):
def get_parser(self, prog_name):
parser = super(ListSnapshot, self).get_parser(prog_name)
parser.add_argument(
+ '--all-projects',
+ action='store_true',
+ default=False,
+ help='Include all projects (admin only)',
+ )
+ parser.add_argument(
'--long',
action='store_true',
default=False,
@@ -149,7 +155,12 @@ class ListSnapshot(lister.Lister):
# Just forget it if there's any trouble
pass
- data = self.app.client_manager.volume.volume_snapshots.list()
+ search_opts = {
+ 'all_tenants': parsed_args.all_projects,
+ }
+
+ data = self.app.client_manager.volume.volume_snapshots.list(
+ search_opts=search_opts)
return (column_headers,
(utils.get_item_properties(
s, columns,