Modified take_action() method for SetFlavor to use
flavor id instead of flavor name when setting description
Closes-Bug: #1844708
Story: #2007781
Task: #40019
Change-Id: If6798c89fef4c9feb4ebb460722b891f5655037d
1. As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2. In py2, the performance about list should be negligible,
see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85
Implements: blueprint replace-iteritems-with-items
There are many references to review.openstack.org, and while the
redirect should work, we can also go ahead and fix them.
Change-Id: I82e3797dd4c05e4944f40c950b4fafe9a5334cbf
--swap will add a additional storage device,
which not affect the original swap partition/device.
This patch will clarify this misleading description.
Change-Id: Ic079c069985d39cc969b97876901007a81883f57
Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
Cleanup help strings and docs for clarity and to keep things consistent:
* --limit metavar should be <num-resource> to indicate what is being counted
* --marker metavar should be <resource> or <resource-id> to indicate the
type of value being specified
* <*-ip-address> metavars should be just <ip-address> as there is no difference
in format between fixed and floating IPs
* Move all occurances of '(name or ID)' to end of help text
Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
This patch adds support to overwrite/clear the flavor's
property using the new ``--no-property`` option in the
``flavor set`` command.
Change-Id: I873c96fcf223bbd638a19b908766d904a84e8431
Implements: blueprint allow-overwrite-set-options
Co-Authored By: zhiyong.dai@easystack.cn
nova actually expects and uses swap size in MB, while in openstackclient
currently help states that swap must be specified in GB and passes this
value to nova without changes.
Fix the help string.
Change-Id: I95f46246c072961ce77f818d80d75e6a51f728d0
Closes-Bug: #1656018
When a private flavor is created with ID auto (=default) and a project
is specified for it, instead of trying to add the project to the flavor
called "auto" the ID of the newly created project should be used.
Change-Id: I19f7a0ec26bd5d147f00ecba3312240e3601567e
Closes-Bug: 1654221
Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.
This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.
Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
Add a attribute "access_project_id" for flavor object to
display the access project id list by using "flavor show"
command.
Change-Id: I7f0c152b816e0ca2e32e47f9b5c1aa7663d33b6d
Closes-Bug:#1575461
Add "--property" option to "flavor create" command to support
adding properties to a new falvor.
Change-Id: I4f06b364375d5a81584fe41122d48e9568fa712a
Closes-Bug: #1596798
Add ``--project`` and ``--project-domain`` options to the
``flavor create`` command. We can use these options to add
the flavor access to a givin project when we create the flavor.
Change-Id: Ic1907272c1d1ae526f9c9e86f32ba06c6da147c0
After this patch, all set/unset commands will return normally
when nothing specified.
Change-Id: Id94d0329faa1a674006a9aae901f834b41917317
Close-bug: #1588588
Support bulk deletion and error handling for "aggregate delete"
and "flavor delete" commands.
Change-Id: I3f6105cbeeab1c9f8cd571c63ce0e7ac3d4252b3
Partially-Implements: blueprint multi-argument-compute
Partial-Bug: #1592906
Use file logger for all command specific logs.
This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
After this patch, all self.log and self.app.log
will be standardized to LOG().
NOTE: In shell.py, we got the log in class OpenStackShell,
which is also known as self.app.log in other classes.
This logger is used to record non-command-specific logs.
So we leave it as-is.
Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
Use osc-lib directly for exceptions.
Leave openstackclient.common.exceptions for deprecation period.
Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
This patch adds "--project" option in "flavor set" command to support
for setting flavor access.
Change-Id: I75b473600080d8ab1dd6ad01561c4f989ed3c3bd
Partial-Bug: #1575461
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
In the "flavor set/unset" command,the "flavor" parameter
can be a name but can not be a id of a flavor.
I think we should find a flavor by using "utils.find_resource()"
in these commands.
Change-Id: I5836788f7ed18813f1ebde31bb808b7c3f932b80
Closes-Bug: #1575624
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
Missing 'marker' and 'limit' params for `openstack flavor list` shell
command. It would be nice to have this when there are many flavors.
Closes-bug: #1505874
Change-Id: I088ac5d24f0d7595f5cbce14f063e296a449eb26
When using openstack flavor unset, the --property is needed,
so the --property should be a required parameter.
Close-Bug: #1474237
Change-Id: Id6913e1b263eddeb5dd44c3edb957206b68f816c
Added flavor set and unset command which allow manage flavor
properties called extra_specs.
Command flavor show output was extended with these properties.
Closes-Bug: 1434137
Change-Id: Ie469bade802de18aab9d58eda3fff46064008163
command to match capabilities already provided by
'nova flavor-list':
—public | --private | --all options allows to list
public only (default), private only or all flavors.
—long displays more field. This option also fetches
properties (extra-specs) for each flavor using separate
API call for each flavor and it’s too slow to be done by
default. However as an administrator - sometimes I need
to be able to see them for all flavors.
Removed empty “Extra Specs” column as well as "Swap" and
"RXTX Factor" from default output.
DocImpact
Closes-Bug: #1416780
Change-Id: I30cfa2c75e28daf17b936543a177c23ae1743c37
try and add some consistency with the show and delete commands.
replace 'show x' with 'display x'
change 'delete a y' with just 'delete y'
Change-Id: I47dfa8ee23ac5c41b355796415eb515155832f65
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
* use six.iteritems()
* replace basestring with six.string_types
* convert print statements to functions (they're all debugging and should
be removed eventually anyway)
* clean up OpenStack copyright: LLC -> Foundation
Change-Id: Icb14212bcb408e63816bfec3922a697bc1a6c946
As discussed in https://review.openstack.org/#/c/36352/ for each
command, we were setting api = identity or volume... etc,
this was for an old way of calling commands that are is no longer
used.
Also removed openstackclient/common/command.py
Change-Id: I2705f35d343f2ae729dc22d6aed0b852b2f8ca19
Most of the arguments required by the create flavor API can have
reasonable defaults and therefore can be made optional in the CLI.
This brings create flavor in line with the documented args in the
wiki at https://wiki.openstack.org/wiki/UnifiedCLI/Mapping#flavor
Change-Id: Iecb3baf72f9dc3981742ff7989780894e37921c9