added the parameter used to show only public plugins
Change-Id: Id8c687f4bb9cfcd15658447d36d3b39fefebfccc
This commit is contained in:
parent
b59b288ac8
commit
9fa43900a4
@ -34,6 +34,7 @@ class PluginManager(base.CreateManager):
|
||||
|
||||
def list(self, marker=None, limit=None,
|
||||
detail=False, sort_key=None, sort_dir=None, fields=None,
|
||||
public=None,
|
||||
with_public=False, all_plugins=False):
|
||||
"""Retrieve a list of plugins.
|
||||
|
||||
@ -77,15 +78,18 @@ class PluginManager(base.CreateManager):
|
||||
|
||||
filters = utils.common_filters(marker, limit, sort_key, sort_dir,
|
||||
fields)
|
||||
|
||||
if with_public:
|
||||
filters.append('with_public=true')
|
||||
if all_plugins:
|
||||
filters.append('all_plugins=true')
|
||||
|
||||
path = ''
|
||||
if detail:
|
||||
path += 'detail'
|
||||
if not public:
|
||||
if with_public:
|
||||
filters.append('with_public=true')
|
||||
if all_plugins:
|
||||
filters.append('all_plugins=true')
|
||||
|
||||
if detail:
|
||||
path += 'detail'
|
||||
|
||||
else:
|
||||
path += 'public'
|
||||
|
||||
if filters:
|
||||
path += '?' + '&'.join(filters)
|
||||
|
@ -82,6 +82,12 @@ def do_plugin_show(cc, args):
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="with public plugins")
|
||||
@cliutils.arg(
|
||||
'--public',
|
||||
dest='public',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="get only public plugins")
|
||||
@cliutils.arg(
|
||||
'--all-plugins',
|
||||
dest='all_plugins',
|
||||
@ -124,6 +130,9 @@ def do_plugin_list(cc, args):
|
||||
if args.with_public:
|
||||
params['with_public'] = args.with_public
|
||||
|
||||
if args.public:
|
||||
params['public'] = args.public
|
||||
|
||||
if args.all_plugins:
|
||||
params['all_plugins'] = args.all_plugins
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user