45 Commits

Author SHA1 Message Date
Jenkins
6329c04297 Merge "OSC Quota List" 2017-03-21 03:56:05 +00:00
Sindhu Devale
58591d3c37 OSC Quota List
Implement Neutron feature of Quota List into
OpenStack Client.

Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57
Partially-Implements: blueprint neutron-client-quota
2017-03-10 14:59:47 +00:00
Reedip
33b092fb9a Trivial Fix
Add a space in the quota error message

Change-Id: I159708b42e86f6b02f8733103a687561d550f650
2017-03-05 18:21:46 +00:00
Dean Troyer
73809a98ed Remove remaining uses of SDK Proxy.session
SDK commit Ie67c240e3caa5e100ce07db3862718195c894748 exposed lingering uses
of Proxy.session in OSC.  Get rid of them.

Change-Id: Icab230f1897a446cf3deb0e3d0550d24e11a0ef3
2017-02-19 15:47:20 -06:00
Dean Troyer
b399b0406c Remove quota set workaround for SDK <0.9.13
Change-Id: I89732c49e73ac5a789fdbe19536389f7e93ac0e6
2017-02-17 13:28:48 -06:00
Huanxuan Ao
0340275fa9 Fix quota set command error for SDK > 0.9.10
A bug in OpenStack SDK 0.9.11 and 0.9.12 that causes
quota set command to fail. This can be removed when
the proposed SDK fix (https://review.openstack.org/#/c/419911/)
is released and in the minimum SDK version in global requirements.

Closes-Bug: #1655445
Change-Id: I63132f5f762f0120282f8b92e72512763063e3c6
2017-01-15 20:00:53 +08:00
Dean Troyer
819526591e Fix quota show --default command
Work around a bug in OpenStack SDK 0.9.11 and 0.9.12 that causes
quota show --default to fail.  This can be removed when the proposed
SDK fix (https://review.openstack.org/420301) is reelased and in the
minimum SDK version in global requirements.

quota set --network is still broken, I can't fix it at the moment...

Closes-bug: 1656572
Change-Id: Ice77e14782c33e672176afbab36bba95b73d7a11
2017-01-14 13:55:19 -06:00
Reedip
024bd3bd66 Fix quota show output
Currently Quota Show expects dictionary to be returned
for Network client, similar to Volume and Compute clients, but
Network Object is being returned, causing the "openstack quota show"
to fail.
This patch takes care of this issue.

Depends-On: Ie0e045ff4888615d68804fd739d5b995ca11e9a1
Change-Id: Ic507997cba09fcfa84dd1151d6922f56a7c5187b
Closes-Bug:#1655537
2017-01-12 22:10:32 +00:00
Steve Martinelli
0ef8535036 translate all command help strings
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
2016-11-17 02:33:42 +00:00
Jenkins
ccd2d658d1 Merge "Fix openstack quota set/show --class not work" 2016-09-20 09:01:16 +00:00
Reedip
91c4509afe Fix quota-update issue in LBaaS
Currently L7Policies cannot be updated( it was missing
in implementation in neutronclient). The same has been
taken care in the current patch.

Also, currently quota doesnt support updating the members
in an LBaaS pool. This patch temporarily removes it, till
it is not confirmed that LBaaS v2 needs to support quotas
for members or not.

Change-Id: I25a54a57debb762a32a280ece8c081fc52365f0f
Closes-Bug: #1624097
2016-09-16 10:57:02 +00:00
Reedip
d3e9361796 Fix Quota Support for HMs
Health Monitors could not be updated using
the `openstack quota update` CLI.

This patch fixes the same.

Change-Id: Ic5a4fa5dce5767e40139137131114834d564f89a
Closes-Bug: #1624225
2016-09-16 12:47:55 +05:30
qtang
2a01ede6b6 Fix openstack quota set/show --class not work
identity_client should not be used for quota class operation.
Update code to fix the qutoa class set/show issue.

Change-Id: I71c59c08a0d5da29982497f589e1efe131997f21
Closes-Bug: #1609233
2016-09-14 11:15:01 +08:00
Rui Chen
6f326acd26 Support fetching network project default quota
Neutron server and openstacksdk had supported to fetch
network project default quota, this patch add the CLI
support in openstackclient.

Change-Id: If0ef74c268c41a866c62156da0603a40ae4e6e31
Closes-Bug: #1204956
Depends-On: I6a4e2a146351dd1e7d652442511f1ef2c279da42
2016-09-13 17:23:22 +08:00
Rui Chen
6fba7163e8 Set quota "per_volume_gigabytes", "backup_gigabytes" and "backups"
"per_volume_gigabytes", "backup_gigabytes" and "backups" items
can be shown in "openstack quota show" command, but can't be
updated by "openstack quota set". This patch fix the issue.

Change-Id: I47db5a69d4e4ef6e140f2735257c83e1fb052760
Closes-Bug: #1609767
2016-09-12 11:00:55 +08:00
Elena Ezhova
b50c2b6a88 Allow setting quotas for server groups and server group members
Adds support of --server-groups and --server-group-members options
to the "quota set" command.

Change-Id: I178d1e267d010be7e908adefcf3b15abdafd9da4
Closes-Bug: #1602223
2016-07-27 13:04:36 +03:00
SongmingYan
1b878b4efd Remove execute permission on a few files
Some files have execute permission unnecessarily. Change them from
755 to 644.

Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
2016-07-22 17:38:34 +00:00
qinchunhua
6f36385cb8 Correct reraising of exception
When an exception was caught and rethrown,
it should call 'raise' without any arguments
because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
2016-07-07 15:05:58 +00:00
Tang Chen
9c62af8a42 Make set/unset commands in compute/image/common return normally when nothing specified
After this patch, all set/unset commands will return normally
when nothing specified.

Change-Id: Id94d0329faa1a674006a9aae901f834b41917317
Close-bug: #1588588
2016-06-21 15:15:18 +08:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Huanxuan Ao
b36d521ff6 Fix i18n supports in commom
I checked all the files in openstackclient/common
and fixed the missing i18n supprots.

Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24
Partial-bug: #1574965
2016-06-07 19:56:00 +08:00
Lu lei
54e81a9984 Add newline to strings in stdout/stderr.write()
Function stdout/stderr.write() can't break line automatically.

Change-Id: I903c2d1cc1a669adb6be5aa4eb783d3b9943e685
2016-06-06 13:54:55 +08:00
Fang Zhen
b92cf77fb5 Add network support for "quota set"
The "quota set" command support compute and volume quotas previously.
This patch add support network.

Partially-implements: blueprint neutron-client-quota
Closes-bug: 1489441

Change-Id: I9d297f52bc30614b3493f09ed15f8f1d3f8ff952
2016-05-19 20:42:59 +08:00
Richard Theis
27024d70af Support quota show for current project
The "os quota show" command "<project/class>" argument is now
optional. If not specified, the user's current project is used.
This allows non-admin users to show quotas for their current
project.

Change-Id: I602d4cc09c9d29ce84271eff78137f8810cb1a47
Closes-Bug: #1572733
2016-04-21 11:33:24 -05:00
Brandon Palm
f49f0fead2 Fixed a bunch of spacing
Nothing too complicated here.  I fixed a bunch of spacing issues
that I saw in OSC.

Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
2016-02-23 10:38:58 -06:00
Jenkins
72fe3e25e2 Merge "Fix showing network quotas for a project" 2016-02-02 04:06:57 +00:00
Richard Theis
5d1a93362d Fix showing network quotas for a project
The OpenStack SDK is now used for the network client. However,
the 'openstack quota show' command wasn't updated for the
client change. As a result, the command will fail to show
network quotas when a project name is specified. For example:

  $ openstack quota show admin
  'Proxy' object has no attribute 'show_quota'

This patch set fixes the command by using the OpenStack SDK
to get network quotas for a project.

Change-Id: I59a7b6780a7b80cd09e79d40d214751b25d3016e
Related-To: blueprint neutron-client
Closes-Bug: #1528249
2016-02-02 02:02:53 +00:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
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
2016-02-02 09:58:32 +09:00
xiexs
0ccd2a8108 Add project name/ID validation for "openstack quota show"
A validation is necessary to check the existence of project.
This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60.

Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
2015-11-29 22:30:04 -05:00
Richard Theis
99498b0ab3 Unable to set some compute quotas
The OpenStackClient mapping of 'openstack quota set' arguments isn't
correct for compute quota items that have to different names.  For
example, the --injected-file-size argument is mapped to
injected_file_size, but the compute quotas item is actually
injected_file_content_bytes.  This incorrect mapping prevented the
impacted compute quota items from being set.

The problem impacts the following 'openstack quota set' arguments:
  --injected-file-size
  --injected-path-size
  --properties
  --secgroup-rules
  --secgroups

This patch set also expands the compute quota unit tests to verify
all compute quota items that can be set.

Change-Id: I0a2f241e425f4811e4ae55be183ac0c8b0805c2a
Closes-Bug: #1475831
2015-11-20 13:08:42 -06:00
xiexs
7d8bb331a0 Add project-name/-id validation for the OSC "openstack quota set"
The quota info would be set into DB, even though the project actually
does not exist.
This patch tried to add a validation to forbid this undesirable behavior.

Change-Id: Ia2d8c96527820e25b074e6486d3f39c5ad7eae60
Closes-Bug: #1512638
2015-11-04 10:22:46 -05:00
Jenkins
6de1af1161 Merge "Add tests for volume quota set" 2015-09-19 03:03:05 +00:00
Joshua Harlow
e3c46ece4a Use a common decorator to log 'take_action' activation
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.

Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
2015-09-01 16:49:54 -07:00
TerryHowe
b1ce0356f2 Add tests for volume quota set
Add some tests for volume quota set and get rid of TODO about
using the value instead of the key to get the attribute.

Change-Id: I57aa57951aeea65965966e63af922cda532d759d
2015-08-11 14:40:53 -06:00
Jenkins
d87403a7bf Merge "Fix quota set failed problem" 2015-08-06 07:34:08 +00:00
TerryHowe
fd61711585 Fix quota show when there is no project id
If no id is in the response, quota show fails.

Change-Id: I9905431b006404c9ba8453eba016cec9ebe19402
Closes-Bug: #1481803
2015-08-05 09:55:29 -06:00
jiaxi
77214c56e7 Fix quota set failed problem
When using the command: openstack quota set, the compute quota below
can't be set successfully,the value of compute quota stay unchanged,
'fixed-ips', 'floating-ips', 'injected-files', 'key-pairs'.

What's more,I add a TODO comment in the code for two reason.
1. volume quota set works fine for the moment.
2. To indicate that this issue about volume needs
   discuss and report another bug, if it's confirmed.

This bug is only about compute quota.

Change-Id: Ic1028d561f5a0030cf65ac18fc117bf01e945478
Partial-Bug: #1420104
2015-07-28 23:21:28 -04:00
Jamie Lennox
179ed18c30 Don't create empty quota set requests
The way that getattr is called with the None default you will always
create a compute_kwargs dictionary with key: None values. This means
that we will always send these empty requests to the servers.

Change so that only actually changed values end up in the quota set
requests and get sent.

Change-Id: I33bc3f4e1a8013ec672e995648d27513064baf26
Closes-Bug: #1451640
2015-05-05 12:45:42 +10:00
Steve Martinelli
8bd8a8dfd7 Add support to specify volume quotas per volume type
Add a --volume-type option to quota set, this will allow users
to set quotas for volume attributes on a per volume-type basis.

for example:
  openstack quota set admin --volume-type myvol --volumes 12

Change-Id: I3ce9cf82a65d4f012b339f0e0dedb752cb132c33
Closes-Bug: 1438377
2015-04-15 01:42:00 -04:00
zhiyuan_cai
54ab9fb230 Add network support to quota show
Currently quota show only lists quotas of Nova and Cinder, we
should make it also support Neutron resources. Also, Nova and
Neutron may have conflicts in the quotas of the following
resources: floating ip, security group and security group rule.
When Neutron is enabled, we should display the quotas of the
above resouces in Neutron, not Nova.

Change-Id: I6e508d2077b6cda41ca93d81a82f39aee0ebfb4c
Closes-Bug: #1411160
2015-01-28 16:26:11 +08:00
zhiyuan_cai
7ea5f89043 Catch exception when getting quota
Quota show command will list both the quotas of nova and cinder.
But if cinder service is not enabled, EndpointNotFound exception
will be raised and thus the command is broken. Catch this exception
so quotas of nova can be listed.

Change-Id: If2d2820675aa6a12e407d608fed846b21c953b2d
Closes-Bug: #1390507
2014-12-30 09:53:26 +08:00
Dean Troyer
254910d3ce Begin copying wiki command list here
* Sort by command objects
* Drop the comparison to the project CLIs
* Minor updates to command help to match docs

Initially include the cross-API commands to establish the structure and format.

Change-Id: I77a7b3c89e088b66aa62941e29ce0b65b532285b
2014-11-19 14:47:53 -06:00
Christian Berendt
3b485de6b0 replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
2014-05-20 13:49:56 +02:00
Dean Troyer
87104a28d7 Add quota commands
* Add quota set and quota show commands; these work on both
  the compute and volume APIs
* Add the --class variation on the above commands

Note: this replaces the existing volume-only quota commands and eliminates quota list

Blueprint: cinder-client
Bug: 1172064

Change-Id: I766d40e410e48f05e36e17e567a4f01a9411b40e
2013-07-17 15:10:22 -05:00