diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-07-26 10:53:40 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-07-26 10:53:40 +0000 |
| commit | 6da7a127af4a5b7ba5fe92b6f09aefe605edb949 (patch) | |
| tree | a4fa263f120aa942f1b625698f9a1af17fcdac0b /openstackclient/volume | |
| parent | 566b8566c00447b8ee8519debde56ddf0e7bf4cf (diff) | |
| parent | e31408d2a4c524181c37ef565b021c0b729cbbe3 (diff) | |
| download | python-openstackclient-6da7a127af4a5b7ba5fe92b6f09aefe605edb949.tar.gz | |
Merge "Add options to "volume type list" command"
Diffstat (limited to 'openstackclient/volume')
| -rw-r--r-- | openstackclient/volume/v2/volume_type.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py index 62d619d0..e42fffe0 100644 --- a/openstackclient/volume/v2/volume_type.py +++ b/openstackclient/volume/v2/volume_type.py @@ -160,6 +160,17 @@ class ListVolumeType(command.Lister): action='store_true', default=False, help=_('List additional fields in output')) + public_group = parser.add_mutually_exclusive_group() + public_group.add_argument( + "--public", + action="store_true", + help=_("List only public types") + ) + public_group.add_argument( + "--private", + action="store_true", + help=_("List only private types (admin only)") + ) return parser def take_action(self, parsed_args): @@ -169,7 +180,14 @@ class ListVolumeType(command.Lister): else: columns = ['ID', 'Name'] column_headers = columns - data = self.app.client_manager.volume.volume_types.list() + + is_public = None + if parsed_args.public: + is_public = True + if parsed_args.private: + is_public = False + data = self.app.client_manager.volume.volume_types.list( + is_public=is_public) return (column_headers, (utils.get_item_properties( s, columns, |
