python-openstackclient/openstackclient/compute/v2
Huanxuan Ao 681d6dc2de Make "flavor show" command to show a private flavor properly
The "flavor show" command could not show a
private flavor by flavor name becauce it could
not find a private flavor by flavor name.
In "until.find_resource(parsed_args.flavor)",
If parsed_args.falvor is a name of a flavor,
"flavors.find(name=parsed_args.flavor)"will be
called to find a flavor.But the default value of
"is_public" is "Ture" in "flavors.find()" so that
we can only find public flavors.If we want to find
all flaovrs by flavor name,we should add
"is_public=None" in "flavors.find()".

So I tried to change
"until.find_resource(parsed_args.flavor)" to
"until.find_resource(parsed_args.flavor, is_public=None)",
but then I could not find any flavor by flavor id
because "is_public" is an unexpected argument of
"flavors.get()" in "until.find_resource()".

In this case,I think "until.find_resource()"
can not find a private flavor properly,and
we should combine "manager.get(flavor.id)" and
"manager.find(name=flavor.name, is_public=None)"
by ourselve to find a flavor.

Also,this bug affects other flavor commands like
"flavor set/unset/delete",so I fix them in this patch too.

Change-Id: I4a4ed7b0a2f522ee04d1c3270afcda7064285c39
Closes-Bug: #1575478
2016-05-02 16:47:53 +08:00
..
__init__.py Remove copyright from empty files 2014-01-20 17:28:13 +04:00
agent.py Make SetAgent inherit from cliff.Command 2016-02-27 03:48:11 +08:00
aggregate.py Add "aggregate unset" to osc 2016-03-24 10:33:23 +08:00
console.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00
fixedip.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00
flavor.py Make "flavor show" command to show a private flavor properly 2016-05-02 16:47:53 +08:00
floatingip.py [Floating IP] Neutron support for "ip floating create" command 2016-03-24 09:07:25 +08:00
floatingippool.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00
host.py [compute] Add set host command 2016-02-26 05:05:46 +08:00
hypervisor.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00
hypervisor_stats.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00
keypair.py Fix keypair create --public-key 2016-03-18 17:48:36 +00:00
server.py Doc: Unify repeatable option comments 2016-04-12 15:57:17 +08:00
server_group.py Add "server group show" command 2016-04-20 03:26:13 +00:00
service.py Log hint when --enable present with --disable-reason 2016-04-05 21:22:27 +08:00
usage.py log take_action parameters in a single place 2016-02-02 09:58:32 +09:00