25 Commits

Author SHA1 Message Date
Sam Morrison
42d6638d3b Use MultiIPField for access form to avoid need for custom validation
Change-Id: If3314e94319056fe45499e83ff1bb15c4d19c64c
2021-03-06 10:45:14 +00:00
Lingxian Kong
25347e64fc Support Restored status for backup
Change-Id: I26e3ca1746d7898334699192ad0581744c613248
2021-03-03 12:09:49 +13:00
Sam Morrison
c3c9525800 Fix up get access method in create_instance workflow
This would never work and would result in a key error.

Story: 2008627
Task: 41831
Change-Id: I0ed17a7761837623c21cd1a0992a71ab0342c791
2021-03-02 21:47:26 +00:00
Ivan Kolodyazhny
c9d6d03a0f Specify database instance access during creation
Change-Id: I75950ae949e7f19e48f5246e4db9f5d5c514dd2b
2021-02-02 23:37:49 +02:00
Zuul
721866f6ed Merge "Fix replication creation" 2020-11-15 21:02:38 +00:00
Ivan Kolodyazhny
8116b2aca0 Fix replica number input type
We don't need to specify input type manually. Django will render
input[type=number] for forms.IntegerField

Change-Id: I4c8d0ae5d82088745bdaa00f15b1c62866cb4070
2020-11-03 22:15:35 +02:00
Ivan Kolodyazhny
5fffb17dc9 Fix replication creation
We should not provide flavor, volume and datastore data during instance
creation for replica.

Change-Id: I32bed10df5d334822a24ba44f70d8727d607e4d4
2020-10-26 21:03:22 +02:00
Lingxian Kong
cccbd65bc2 Remove unsupported network param for creating instance
Change-Id: I27593b7fd7f05efd8852799f214ce0ae14be78c4
2020-05-24 00:22:51 +12: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
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
Mark Giles
56d8502dae Fix leak of password info in logs.
When launching a database instance, user info is logged at info
level.  This user info includes password information that should
not appear in the logs.  This fix removes logging of user info.

Change-Id: I97206a3fe0c19ee7cb7333ed27518134079f26d0
2017-11-13 13:30:53 -05:00
Duk Loi
66b826868c Restrict launch fields when restoring from backup
When restoring from backup the launch wizard contains all options
and performs no customizations based on the information contained
in the backup.

This patch adds support for restricting the launch instance
datastore field to the datastore and datastore version that the
backup is relevant to.

It also populates the restored backup as the only option in the
advanced step backup field.

Added a unit test to validate the fields were populated correctly.

Change-Id: Iabfefd34b5f7a24699277104fa92ac77b2c74fe3
Closes-Bug: #1647746
2017-06-16 01:36:05 +00:00
Ali Adil
9017120b24 Add availability zone to launch instance
Added the availability zone pulldown that is populated from a nova
call.

Updated the api to accept the availability zone and modified the
tests correspondingly.

Change-Id: I21abab45512637e16bdf41f52f986e19cbbd9785
Closes-Bug: #1611951
2016-09-12 23:20:52 -04:00
Ali Asgar Adil
9a5de1ee6a Add support for affinity/anti-affinity
Added a locality pulldown to specify None/affinity/anti-affinity
in the launch instance dialog.

Modified the locality value to None if the launched instance is a
replica.

Modified the trove api to use the new locality parameter.

Change-Id: I64e4b192b1e495231a6c0f663cb947e417d99db0
Closes-Bug: #1615834
2016-09-12 20:33:43 +00:00
Matt Van Dijk
949522f875 Add support for Trove configuration groups
Added attach/detach configuration group actions to the instances table.

Added tab to launch dialog to select a configuration group to
associate with the instance.

Added "Configuration Groups" panel which displays existing
configuration groups and allows the user to create new or delete
existing configuration groups.

Added a details screen with three tabs (Values, Instances, Details).
* The Values tab displays the list of all name/value parameters
associated with a configuration group along with actions to add new
parameters, delete existing parameters, discard changes and
apply changes.  Values can be modified in the table directly.
* The Instances tab displays the instances that the configuration
group is associated with along with actions to detach the
configuration group from the instance.
* The Details tab displays additional information on the
configuration group.

Added a configuration defaults tab to the database instance details.
Use a cache for storing changes to the configuration group.

Change-Id: Idbd6775342968c1659ca1e9b02dcb697750530b6
Co-Authored-By: Andrew Bramley <andrew@tesora.com>
Co-Authored-By: Duk Loi <duk@tesora.com>
Implements: blueprint trove-configuration-group-support
2016-09-09 12:05:22 -04:00
Duk Loi
e1c44b2092 Add support for instance datastore-flavors
Update the launch wizard to use datastore-flavors instead of
flavor-list.

When selecting a datastore the flavor list will change to display only
flavors for the selected datastore.

If the datastore flavor is not configured then the default flavor
list will be used.

Updated unit tests to use the datastore flavors.

Change-Id: I4bf0033a3e6b2a117f93db2c0c16a6d02642f368
Closes-Bug: #1549367
2016-08-05 11:16:05 -04:00
Duk Loi
c21af82cb5 Get all instances to populate master pulldown
The call to gather all instances to populate the master pulldown in
the launch database instance wizard will never exceed the default
pagination size because the call is only made once and never checks
if there is more data.

Looped the call to obtain instances until there is no more data to
retrieve.

Added a unit test.

Change-Id: I5bf8cd1aca260e92d2b4d192b5b34c164e67cb37
Closes-Bug: #1549937
2016-05-16 15:12:25 -04:00
Duk Loi
af46a6123e Delegate network panel to instance network panel
The network panel in Trove's launch instance panel is a duplicate
of the Nova launch instance panel.  Delegate the call in the
Trove panel to use the Nove network panel to avoid code skew.

Change-Id: I623e67a062654cfd62aa627b0b7ee4517413bcd4
Closes-Bug: #1580527
2016-05-11 09:45:23 -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
Duk Loi
44d750ecfb Add missing replication functionality
Add Horizon support for ejecting replica sources, promoting replicas
and specifying the replica count when launching instances based on
a master instance.

Added a promote row action to the instance table that is available
only when the instance is active and is a replica.
Added a confirmation dialog that displays information on the current
replica and replica source.

Added an eject row action to the instances table that is only
visible when the instance is a replica source.

Added an integer field to specify the number of replicas to start
on the advanced tab in the Launch instance dialog.  This field
appears only when a replica source is selected and has a minimum
value of 1.

Modified the trove create instance api to include the replica count
and new apis for eject and promote.

Change-Id: I67c2a91f6476ebe01c2b03ed529feac49411769b
Closes-Bug: #1551807
2016-03-17 19:50:18 +00:00
Duk Loi
4a85ec5c2a Add volume type field to launch instance dialog
With the addition of Cinder volume type support in the CLI the
corresponding change is needed in Horizon.

In the launch instance dialog added the volume type field pulldown.
It will be populated by a call to cinder volume_type_list.

The default value will be prepended to the list as "no_type".  This
default is used in the cinder panels.

Updated api and tests to account for new cinder calls and
add the default value to the post commands in the tests.

Change-Id: I7fb2404ccf9d42c293bde1a708518e108f9a1625
Closes-Bug: #1551340
2016-02-29 17:34:29 -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