Commit Graph

25 Commits

Author SHA1 Message Date
Takashi Kajinami ad40231928 Replace deprecated ugettext_lazy and ungettext_lazy
The ugettext_lazy method and the ungettext_lazy method are both
deprecated since Django 3.0[1].

These were already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/3.0/releases/3.0/#id3
[2] cd7c1b5110fe1f64cd9dfbeb1072b37912d0efee

Change-Id: I4008e4439d568e0ffedd575870d4bc48c1cc62e5
2022-07-21 20:43:43 +09:00
manchandavishal b1a2f6c77b Cleanup for Refactor-error-messages
This patch is a clean-up patch for refactor-error-messages bp
which remove the exception message from base message otherwise
the same exception message display twice like
this https://ibb.co/XyFWMdz .

Depends-On: https://review.opendev.org/#/c/708069/
Change-Id: I89df4b9681da759ba5a5b898f1de63e85351bbce
2020-08-28 18:59:55 +00:00
Akihiro Motoki 06f7b483a8 Remove six usage
This repo does not support Python 2 anymore, so we don't need
six for compatibility between Python2 and 3, convert six usage to Python
3 code.

Change-Id: I3edab6e67ac79d14fe9d38f6f75abfd50030fa1e
Needed-By: https://review.opendev.org/701743
2020-01-12 02:42:29 +09:00
Akihiro Motoki ddaf10204a Django 2.0 support
Replace django.core.urlresolves with django.urls

(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

The arguments of include() has been changed in Django 1.9
and the older style was dropped in Django 2.0.
https://docs.djangoproject.com/en/2.0/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include

Add py35dj20 job to test Django 2.0 integration.
Also drops older Django unit tests from tox.ini
as horizon dropped Django <=1.10 support in Rocky.

Depends-On: https://review.openstack.org/#/c/571061/
Change-Id: I122f8ad81807386517149f37aa8d63c76daac533
2018-06-08 13:27:11 +09:00
Zhao Chao 721da6ac3e Avoid using hasattr() on troveclient resources for py3 porting
troveclient resources use the lazy-loading feature, which causes problems
for calling hasttr() on the object. copy.deepcopy() also use hasattr(),
and results in infinite loops. hasattr() will ignore any exceptions under
Python 2.x, but reraise them under Python 3, this is reason why the related
test cases passed under Python 2.x and keep failing under Python 3. This
patch fixes and should be the last one to fix the py35 gate jobs.

Partial-Bug: #1755413

Change-Id: I97492605047a986d3075a8b5f22ecbfdb3af8aca
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
2018-03-15 23:43:27 +08:00
Zhao Chao 996e134a1c Fix str and dict usages in unittests for Python3
- use six.text_type instead of unicode for assertion;
- use dict.items() instead of dict.iteritems() for dict iteration;
- use six.text_type to capture exception messages, the 'message' attribute
  is no longer existing;
- dict.keys() returns a dict_keys object under Python3 which cannot be
  reversed, explicitly convert it to a list.

Partial-Bug: #1755413

Change-Id: I5d31397b7bfe08b504ee5b9cd4ff894031f66c2b
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
2018-03-15 21:23:05 +08:00
Zhao Chao a5cc40f488 Fix binascii hexlify under Python 3
Add wrapper functions for binascii hexlify/unhexlify to deal with the
conversion between bytes and str.

Partial-Bug: #1755413

Change-Id: I8351b30b62ba19290e05c30499c3588649f8f367
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
2018-03-14 17:37:04 +08:00
yatinkarel c0871b8f9c Switch to oslo_log
Trove dashboard is currently using python logging module to
implement logging functionality.
This patch made a switch to oslo.log(logging for openstack projects)

Reference:-
http://docs.openstack.org/developer/oslo.log

Change-Id: I92a417a7342f4f264e8a5ede52ba49f0b7475e6d
Closes-Bug: #1656167
2018-01-11 04:37:41 +00:00
Duk Loi f7d0b9f771 Add support for uppercase fieldname to cluster
The datastore flavor field was not properly implemented because
not every datastore flavor had it's own flavor pulldown.
Properly implemented a datastore pulldown for every flavor that
is only visible when the corresponding datastore value is selected.

Also added code to protect against uppercase letters in the
datastore or datastore version name.

Change-Id: I7a8083733a7d613c56652f3884d2682bb54379b3
Closes-Bug: #1614650
2017-06-16 01:37:36 +00:00
qiaomin 0ad8436bae Remove the redundant "required=True"
The django form field default is "required=True", so this patch
remove the redundant "required=True" in the form.

Change-Id: If0a5e6086a5898670643cc8f2cc0f97822ad063b
2017-01-11 14:41:45 +08:00
Jenkins ce995f514a Merge "Add cluster support for affinity/anti-affinity" 2016-09-14 15:12:31 +00:00
Ali Adil 9e89be3f2b Add cluster support for affinity/anti-affinity
Added a locality pulldown to specify None/affinity/anti-affinity
in the launch cluster dialog.

Modified the horizon trove api to use the new locality parameter in
the launch cluster dialog.

Change-Id: Iac08b34958408d81aaf7bc0cd699bdafb7e7d3d7
Closes-Bug: #1611919
2016-09-13 20:52:48 +00:00
Jenkins 16a839e22c Merge "Add nic to cluster grow" 2016-09-13 16:15:40 +00:00
Jenkins 83b1e4195b Merge "Properly populate cluster id in instance grow" 2016-09-12 18:18:53 +00:00
Ali Asgar Adil a3e66039c1 Use proper check for inactive datastore version
The cluster launch use the improper check for inactive datastore
versions.

Updated to use the proper check for inactive datastore
versions so that they are filtered from the datastore list.

Change-Id: Id095bbf049dd3065ecb7e05b9956f6a2bb2550b2
Closes-Bug: #1614589
2016-09-06 19:08:32 +00:00
Ali Adil d53d2efbc6 Add nic to cluster grow
Added nic field to grow add instance form, the summary added instance
table, cached object and the api.

Change-Id: I927b3a233f9e6a97535dd9882d23393e8197b75a
Closes-bug: #1613449
2016-08-16 16:35:57 -04:00
Ali Adil 0d15ccb29e Properly populate cluster id in instance grow
The form to add an instance to grow a cluster had a hidden cluster_id
field that was not being populated.

The cache uses this cluster_id to keep track of the instances which
are used to grow the cluster.

Properly added the code to correctly populate the field.

Change-Id: Ie9a1e481aeb4c1ae015ae66835392b9534fbee05
Closes-Bug: #1611468
2016-08-09 15:53:57 -04:00
Duk Loi fedcd092da Fix the active attribute check
The datastore version object only contains the active attribute
when the user is an admin user.  The datastore version object for
non-admin users does not have the active attribute.  The absence
of the active attribute should be considered active.

Fixed the active attribute check to account for the case when the
attribute is missing.

Also modified the test data to create a datastore version without
the active attribute to test this scenario.

Change-Id: Ie134a69f57b92bc5fab97860d2839bd9c7f496ec
Closes-Bug: #1573232
2016-04-21 16:44:34 -04:00
Matt Van Dijk 3ea4a7ca62 Trove add cluster grow and shrink support
Add support for Trove commands cluster-grow and cluster-shrink.

Added the grow and shrink actions to the clusters list table.  The
grow and shrink actions are only available for MongoDB and Redis
clusters.

Added the grow panel table to list the new instances to be added to
the cluster.  There is a table action Add Instance where the instance
details are specified then added to the new instances table.
A Remove Instance table and row action is available to remove any
instances from the table.  A Grow Cluster table action will add the
instances to the instances in the table to the cluster.  Removed the
add shard action as it is now deprecated and is replaced by the
grow action.

Added a cluster manager helper to keep track of the newly added
instances in the grow panel.

Added the shrink panel table that lists the instances belonging to
the cluster in a table.  The selected instance(s) can then be
removed from the cluster with the shrink command.

Added the cluster_grow and cluster_shrink commands to the api.

Change-Id: I05dbc73282b333e3ed8cfd4cdbda673ec86f57fd
Co-Authored-By: Duk Loi <duk@tesora.com>
Implements: blueprint trove-support-cluster-grow-shrink
2016-02-25 16:54:41 -05:00
Duk Loi ba59637824 Adding support for trove new clustering datastore - percona cluster
Adding support for percona xtradb cluster server for trove.

Change-Id: Id7751f7f45817fe89ac454eb795967cb60a029c8
Co-Authored-By: Craig Vyvial <cp16net@gmail.com>
2016-02-22 16:46:29 +00:00
Jenkins 18b56cac94 Merge "Enable Redis database cluster support" 2016-02-22 15:07:56 +00:00
Matt Van Dijk d09319b786 Enable Redis database cluster support
The Launch Cluster dialog only supports datastore clusters that
Trove can deploy.  Redis clusters can now be deployed by Trove.
The Launch Cluster dialog requires the following changes for Redis.

- Customized the Launch Cluster dialog fields for Redis
- Added a new Redis specific cluster details panel.
- Modified the Trove api to specify the volume parameter in
cluster_create only if the value is greater than 0.
- Added Redis to the db_capability helper.
- Modified the Trove test data and added unit tests for the
customized fields depending on the datastore selected.

Change-Id: I902b09d9f8a60da6276acb810e2ce616484ea51c
Co-Authored-By: Duk Loi <duk@tesora.com>
Implements: blueprint trove-enable-redis-clustering-support
2016-02-18 15:36:12 -05:00
Matt Van Dijk de24b499d3 Fix cluster launch datastore version handling
Cluster launch currently does not handle datastore versions containing
dashes. This is because it splits on all dashes in the full datastore
string ('name-version'). The fix is to only split on the first dash.

Change-Id: I1d3c7f1283e26ddca2a44f41a8464007fd278adb
Closes-Bug: #1536255
2016-01-20 11:42:39 -05:00
David Lyle bac61fbfd2 Completing the plugin
Change-Id: I410aaac24b76e63a82d6c50364e46d54ead03b05
2015-12-18 15:53:31 -07:00
David Lyle 9f35f7774b Restructuring tree to be plugin 2015-12-18 15:28:23 -07:00