Commit Graph

24 Commits

Author SHA1 Message Date
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
Pedro Kostelec ae7896cea5 Consisent abbreviation of size units
Most units (KB, MB, GB, TB, PB) are shown in an abbreviated format.
The exception were bytes, which where shown as "Bytes". This commit
resolves this inconsistency by showing "B" for byte units.

Change-Id: Ied94c777a70bf8955f5a328ffcb63d98a7a2befd
Closes-Bug: 1411595
Signed-off-by: Iago Estrela <hiagoestrelas@gmail.com>
2021-05-04 11:50:17 -03:00
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
wei.ying e0e81e2b87 Add server groups and server group members quota management in Horizon
Currently we can't set server groups and server group members quotas
in Horizon, they are still the back end definition of default.
In some cases, it will failed to create an instance when server group
members quota is insufficient. Therefore, it is necessary to specify
the quota of the server groups and server group members when creating
and editing the project. This patch allows the user to modify the
default values for the server groups and the server group members
quota.

Change-Id: Ifbd51bec3e775d8fecbf110da37309a443a3d1ba
Closes-Bug:#1732429
2018-05-06 00:33:41 +08:00
Akihiro Motoki f61b3fd03d Modularize workflow action in quota defaults
This is a preparation to support quotas for horizon plugins.

Part of blueprint horizon-plugin-tab-for-info-and-quotas
Change-Id: I11f9bfb6edae205f452e2619b33fa52254dcf37a
2018-04-11 14:23:23 +00:00
Akihiro Motoki 2ad9f81483 Tabbity quota default update workflow
Part of blueprint horizon-plugin-tab-for-info-and-quotas
Change-Id: Ieead15fe24cdc5cea94aea29d7fc0051ba33fb71
2018-03-28 05:00:13 +09:00
Akihiro Motoki 34fb3e5b0e quota: Disable nova-network quotas completely
nova-network quotas are considered in usage/quotas.py previously.
This commit completely always disables nova-network quotas.

The nova API wrapper ensures nova-network quota fileds are not
included in responses from tenant_quota_get and default_quota_get.

Drop nova-network quota fields from the Admin Defaults panel and
the Identity Project quota form.

blueprint make-quotas-great-again
Change-Id: Ie69d3003f62d3a124d79a1fea003092f73372187
2017-12-13 20:27:02 +09:00
Radomir Dopieralski cc6c0cf36a Make UpdateDefaultQuotas handling more robust to missing form fields
Prevent raising of KeyError when one or more fields are missing in
the form data.

Change-Id: Icf795651773289ecc3b4ef5f22626947bdb5ccd2
Closes-bug: #1688577
2017-05-09 16:43:05 +02:00
Itxaka 4958805863 Merge "missing" quotas with nova quotas
There was an extra variable for the so called "missing"
quotas since 2013. This patch merges them with the
normal nova quotas, cleans up the tests, removes any
usage of that special var and as a side effect, adds
the missing keys to the project quota update page.

Change-Id: Icaac1ebb1749e13fdfc307e89dcc6bbd64bef922
Closes-Bug: 1655393
2017-03-01 15:30:33 +00:00
Huachao Mao dbe502042f fix some pylint warnings
Change-Id: I65c5111fe3466ab250473546a951d2c86b130131
2016-12-22 07:17:13 +08:00
IWAMOTO Toshihiro 2e59431227 Look for volumev2 endpoints instead of volume
Volumes tabs should be enabled when volumev2 endpoint is registered.
Currently, Horizon considers no volume service is running if there
is no V1 endpoint, which doesn't make sense as Horizon no longer
supports the cinder V1 protocol.

Co-Authored-By: itxaka <itxaka@redhat.com>
Change-Id: I35d821eedb75f73f9330ed11f921694104eed0c6
Closes-Bug: 1415712
2016-02-23 11:47:25 +01:00
Jenkins 957ddd2ffe Merge "Fix return value in "Update default quota"" 2015-12-17 03:23:06 +00:00
Rich Hagarty 70ade476b8 Use "GiB" and "gibibyte" labels in volume panels
Cinder APIs require size values to be in gibibytes (GiB).
Horizon panels show these values in gigabytes (GB), which
confuses storage admins.

Change-Id: I62ab332d3415f35ead237dd1af5f6a11eb193654
Partially-Implements: blueprint gb-to-gib-conversion
Closes-bug: #1511167
2015-12-11 07:28:42 -08:00
kenji-ishii 5c31cf2c81 Fix return value in "Update default quota"
"Update default quota" execute two apis
(nova.default_quota_update and cinder.default_quota_update).
At the moment, method of "handle" always retuen True,
even if both of their apis failed. Then success message is
displayed in spite of failure. I modifyed it. If both API
was an error, it returns False. And in this case, Horizon
will display only error message.

Change-Id: Icd0990a091cd59e3bf07094db59f71fe29c3c195
Closes-bug: #1517741
2015-12-09 01:05:10 +09:00
lin-hua-cheng 0cde6aa055 Move to hacking 0.10
Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H307, H803 and H904 has been removed.

Fix code issues with H238 and W292.

Change-Id: I747ebb64db5825bc70f1ae19c1c1f5ca2089c06d
2015-02-04 20:27:07 -08:00
Akihiro Motoki 393642fd02 Fix E128 errors in openstack_dashboard/dashboards/admin/
E128 continuation line under-indented for visual indent

Partial-Bug: #1375929
Change-Id: I7a258d624f35b602da07c9b8604fb26c63287824
2014-10-15 13:50:07 +09:00
Sergio Cazzolato b2dd9ded59 Revert "Remove the update default quotas feature"
This reverts commit ed586a0355.

The quota_class subcommand in python-novaclient was used to set default
quota values so it shouldn't have been removed. As now it is being
restored, the defaults quota panel is being restored too.

Related mailing list thread on the topic:
http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Resolved merge conflicts by hand in:
openstack_dashboard/api/cinder.py
openstack_dashboard/dashboards/admin/info/tabs.py
openstack_dashboard/dashboards/admin/info/tests.py

Updated translatable segments to match refactors in
openstack_dashboard/dashboards/admin/defaults/workflows.py
openstack_dashboard/dashboards/admin/defaults/tables.py

Fixed most egregious post-merge styling errors in
openstack_dashboard/dashboards/admin/defaults/templates/defaults/index.html
(probably should have been separate, but I just couldn't let it out that way!)

Removed unrelated file that was allowed to be part of the original commit
doc/source/topics/settings.rst

Co-Authored-By: Doug Fish <drfish@us.ibm.com>
Change-Id: Ic4c4ecec843c7ea9afd0db36ce0eb15952da15b3
Partial-Bug: #1299517
2014-09-30 18:12:02 +09:00
Sergio Cazzolato ed586a0355 Remove the update default quotas feature
The default quota panel has been moved to a tab in the system
info panel.
The update default quotas feature has been removed.
The cinder quota-class methods have been removed to keep consistency.
The test cases and the apis for nova and cinder have been modified
according the change.

This change is done to support the change:
I1110022d6f628d03aaf363da707f2d2ef1600437

Change-Id: I193c7209d9681b6d69afe0d996153ac86850d243
Closes-Bug: #1292589
2014-03-26 12:19:21 -03:00
Jenkins 84e375d7db Merge "The order of fields have changed for update default quota form." 2014-02-26 23:17:33 +00:00
Ana Krivokapic 0460c6ce63 Rename UpdateDefaultQuotas to UpdateDefaultQuotasStep
A class with the name of UpdateDefaultQuotas was declared twice in the
same file. Rename one occurrence to UpdateDefaultQuotasStep.

Change-Id: Ie2adb0d540656c5b106607bfc992f553ad1fa45b
Closes-Bug: #1285135
2014-02-26 13:43:32 +01:00
Tapan Sharma 8d7ea95f84 The order of fields have changed for update default quota form.
Changed the ordering of the the fields for update default quota form
so that it now matches the default quota table page.

Change-Id: I76c5b75f30d9db39c83b395bffbf11340b2e0bde
Closes-Bug: #1275892
2014-02-04 12:07:55 -08:00
heather bd488b93f7 Change 'update default quotas' success and failure messages
Success and failure messages include formatting that adds name,
which makes for awkward phrasing when displayed to the user.
Removed formatting to clarify message text for both success and
failure messages.

Change-Id: Id754ec9cb132ba82c07c13b05c76367739d3faaf
Closes-Bug: #1274654
2014-01-31 06:54:41 -08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
liyingjun 5f8e370f2d Allow admins to update default quotas
Add update default quotas form to edit the default quotas.

Move the editable default quotas tab to a new panel called
"Defaults".

Implements blueprint edit-default-quota

Change-Id: I6e3806226cd2f699f16b93c25e294bc67883738f
2013-08-29 23:18:08 +08:00