Commit Graph

102 Commits

Author SHA1 Message Date
Zuul 5e73220a5f Merge "Django 4.x: Replace removed features" 2023-02-20 17:56:57 +00:00
Corey Bryant d956d059f9 Django 4.x: Replace removed features
force_text(), ugettext_lazy(), ungettext_lazy(), urlquote_plus()
and is_ajax() are removed in 4.0.
https: //docs.djangoproject.com/en/4.0/releases/4.0/

Co-Authored-By: manchandavishal <manchandavishal143@gmail.com>

Change-Id: I9e43926cc3011b8b7321bbec59bebe915502eb4a
2022-12-01 23:05:33 +05:30
Andy Botting 8aceeda565 Add designate support for Zone choice
This commit adds support for Designate zones. This can be used to
provide the user a drop down list of zones they can choose from when
launching apps.

This should be coupled with a commit to murano to add a new
io.murano.resources.RecordSet resource type, so that new a new DNS
record can be added for new apps.

Change-Id: I71deb3e264b2777ec4126d8e46c3ac45b9fc42c6
2022-10-12 04:54:52 +00:00
zhurong f91d017789 Remove six
Change-Id: I15ab42b44fbc40a66a52d1fd16087ee18c8b0494
2020-04-21 05:53:26 +00:00
Andreas Jaeger c80e23edfd Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: I7073a478d38fb46619e7a300808e9449403e704d
2020-03-30 10:49:50 +00:00
Andy Botting a8848d9a2f Make sensible default choices for fields
This commit makes some sensible default choices for fields
when adding and application to an environment. These are applied
to the image and keypairs fields.

In both cases, if only one option is available, then make that
the initial value selected.

In the images case, we take it a step further and if there is
only one image, make that the only choice, dropping the
'Select Image' option completely.

Change-Id: I24462374a50c1b8d83970f10278362f3dc5daf8b
2019-08-15 14:55:32 +10:00
Andy Botting 5838b91435 Hide availability zones that are not available
Availability zones that were unavailable should have been filtered
from the list, but weren't due to incomplete filtering.

This commit specifically tests whether the AZ status is available
before allowing it in the list of choices.

This filtering mechanism is the same as how the OpenStack dashboard
'Launch Instance' dialog handles availability zone availability.

Change-Id: I8bdb38e29209aff92f51532812b409e48462a0af
2019-07-25 15:05:28 +10:00
zhurong 9eec74f84b Change import module nova to _nova
Since horizon separate module nova to _nova in commit [0],
change this for murano-dashboard.

[0]: If91cf4f30d2ddab471757129c2a74b26b6d38b1e

Change-Id: I4160342c571a5c0d952f96503de920fedc88a33b
2019-03-04 17:16:39 +08:00
zhurong 87f1b5b658 Django 2.0 support and fix lower-constraints tox env
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

Add py35dj20 job to test Django 2.0 integration.
And update the lower-constraints.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Co-Authored-By: Ellen Batbouta <ellen.batbouta@oracle.com>

Change-Id: I3456162c934eb48ccf180d80b5cf7ff5614221c0
2018-06-13 12:03:55 +00:00
Aleksey Nakoryakov 93d8a1e160 Show resource usages for application
Show them in the description section right under the Flavor field
title (as quota usages + predicted increment progress bar).

Co-Authored-By: Timur Sufiev <tsufiev@gmail.com>
Co-Authored-By: Artem Tiumentcev <darland.maik@gmail.com>
Change-Id: I842cbce209ea90ab715d2e50824296a19c202a76
2018-01-17 04:26:25 +00:00
Devjani Ray 259cb419e3 Display volume snapshots only in volume field
Add an attribute include_volumes to the volume form element. If set to
true (the default -- maintains backward compatibility), the list will
include available volumes. If set to false, the list will not include
volumes.
To display available snapshots, set attributes include_snapshots to
true and include_volumes to false.

DocImpact
Closes-Bug: #1732208

Change-Id: I243326e9a68eafcdf367a4fbbdaea7b447550b9a
2017-12-04 16:11:18 -05:00
zhurong d76bbb9949 Revert ThemableSelectWidget for themable selects
Now horizon ThemableSelectWidget field can not display
the validation error, just make the field keep the old
can temporary fix this. Once horizon fixed,
we can revert it back.

This reverts commit 85fc5e002c.
Closes-Bug: #1711763

Change-Id: I557d38f739786597a9472c8104e1edf531e9a007
2017-08-25 10:30:42 +08:00
Ivan Zinoviev 5c47a76bb7 Allow specification of only neutron net without subnet
in addition to existing approach where we are allowed to choose only
network with specific subnet.
It is useful when we have lots of small subnets and it is possible
to exceed amount of available IP addresses in it. In this case, we
will allow user to specify only network and delegate subnet choice
to server.

Change-Id: I23c21fe65552c0def527c98a5fa6a4eae56a6a7a
2017-07-18 12:25:14 +03:00
Gerry Buteau 300503e459 Fix security group choice field population
The network abstraction layer has been removed from
horizon/openstack_dashboard API.

See:
  https://review.openstack.org/#/c/466645/
  https://review.openstack.org/#/q/topic:bp/drop-nova-network

Use neutron API to populate the list of existing
security groups instead.

Closes-Bug: 1697688
Change-Id: I57b92974db3f510f69e7e552d53cefa28a53d9ad
2017-06-27 09:59:40 -04:00
devray af297da1a8 Add widget for volume selection
Murano provides support for attaching Cinder volumes to instances and
booting instances from existing volumes. However, there is no way for
a user to select an existing volume (or volume snapshot) using the
murano dynamic UI.
This patch provides a way to show and select available volumes or
volume snapshots.

Change-Id: Ic99443384180c8d0df33e2b7c15b8e56cd086da3
Implements: blueprint volume-selection-ui-element
2017-06-16 15:46:03 -04:00
Jenkins 82824c3fef Merge "Add widget for choosing an existing security group" 2017-05-23 19:29:13 +00:00
Paul Bourke 11743af8c4 Add widget for choosing an existing security group
Change-Id: Iaa23ea5e18459e97dced6ee20191d83a2dec66dd
Depends-On: I60d37cfe034c467e894ee93cf3718e463bf49337
Implements: blueprint app-use-existing-security-group
2017-05-23 16:04:52 +00:00
Felipe Monteiro 273ed4797e Update glanceclient from v1 to v2 to avoid deprecation errors.
Currently, the app-catalog/images view in Horizon is throwing
a 300 HttpMultipleChoices exception, with the details:
"Requested version of OpenStack Images API is not available."

Also, the glance v1 client is deprecated, so we should move to glance
v2 wherever possible.

This patch, therefore, removes glanceclient v1 dependency
from murano dashboard as much as possible, especially
given that Glance team intends on removing it from Pike [0].

The only remaining places where the glanceclient v1 is kept
are:
  - in _ensure_images in muranodashboard/packages/views.py,
    which uses copy_from functionality from glanceclient v1 to load
    images automatically.
  - done in ImportPackageWizard, which sets each package to
    public if the image that was uploaded was public

[0] https://review.openstack.org/#/c/328390/

Closes-Bug: #1675171
Partially-Implements blueprint: migrate-to-glance-v2
Change-Id: Id5348bc34216d5f5ed7fbb8caf71139d64db3f61
2017-04-22 20:16:23 +00:00
Felipe Monteiro 5b78e0dd4b Fix themable image choicefield display text bug
Following a recent patch [0], image choicefields with themable
widgets are not rendering display correctly.

This patch fixes the bug, correctly formatting the image display
names.

[0] https://review.openstack.org/#/c/452771/

Change-Id: Ide558af94cd1484f7bada414658da5d1319ab384
Closes-Bug: #1684141
2017-04-19 15:30:58 +01:00
zhurong f9e18f725c Filter out the snapshot image type
Create the snapshot will copy the image's metadata,
so the snapshot image type will show in the Image table
and configure application image field.
This patch filter out the snapshot image type.

Change-Id: I4a93b75730da9a0f3a9969687e684ee8dfeff815
Closes-Bug: #1650403
2017-04-11 16:02:41 +08:00
Felipe Monteiro 85fc5e002c Use ThemableSelectWidget for themable selects.
This is a trivial fix, meant to align with recent Horizon change
[0], and is just an aesthetic change.

The select widgets are now themable.

[0] https://review.openstack.org/#/c/440978/

Change-Id: Ia903b1d5e72ee6ce08a5bcec3e92b561fcb8b9c6
2017-04-05 00:31:05 +01:00
Artem Tiumentcev a1bfa66a1b Add js validation for dynamic UI
We are getting a regex pattern and error message from UI definition
and paste them as an attribute to a input field for js validation

Change-Id: If6d69462ebc883f5c7ca8dbe18de7df6386d53ce
Implements: blueprint murano-dynamic-ui-custom-realtime-validation
2017-03-10 08:14:36 +00:00
zhurong 3ba5bfd86b Let flavor fields show the default value
Now there is no way to define initial value for flavor field.
This patch fix this.

Change-Id: I966370ced17e39fbe8570226c655fb805cc4e879
Closes-Bug: #1650406
2017-01-12 09:21:20 +08:00
Stan Lagun 8c6dd38b1a Sort values in standard dropdowns
There are number of standard Dynamic UI types that are rendered with
dropdowns: flavors, images, keypairs and availability zones.
The problem is that their values are not sorted.
For example, the image list order might be different on each form open.

Change-Id: I0e75bf6f763bb11e3494659fa8a468201606c3e1
Closes-Bug: #1642374
2016-11-16 14:28:04 -08:00
Stan Lagun a4bcaa1e60 Add Parameters section to UI definition
- Parameters is a key/value dictionary section
where keys are YAQL variable names and values can be either
a YAQL expression or a prepopulated constants. Expressions are evaluated
at the very beginning of a form lifecycle.
- Parameters are accessible using regular YAQL variable syntax ($something)
- Any values within form definitions (title, initial, required etc.) now can be a YAQL expressions that are evaluated before for is rendered but after the parameters are ready so they can be used in the form definitions
- Latest UI definition version was raised to 2.4
- Also now it is possible to provide choices for the choice type control in a form of key/value (dictionary) in addition to list of tuples

Change-Id: I41605ec829d012a69327bc09277dddee5a922bef
2016-11-10 14:00:39 -08:00
Felipe Monteiro 4bc89b51a7 Fixes RuntimeError thrown by finalize_properties in Dynamic UI
Fields.

This issue only affects Python 3.0+

RuntimeError: dictionary changed size during iteration is thrown
by the function mentioned above, because it iterates over kwargs
while deleting entries from it.

Change-Id: I4523296be770bddaeffff7f7ded9501ccc42cbdd
Closes-Bug: #1638928
2016-11-03 10:05:56 -04:00
Artem Tiumentcev d50cb35ece Fix js validation of the password in dynamic UI
Before this patch clicking on an eye icon disabled javascript
validation of the password. I added to password field
the attribute 'data-type=password' and in js changed
the selector to include new attribute in the selector,
that attaches the check function.

Change-Id: Ic7e57814a68c315e570c120f31febdada73079a7
Closes-Bug: #1567859
2016-09-28 10:10:29 +03:00
Kirill Zaitsev 67223ea1f0 Rename 'murano' dashboard to 'app-catalog'
Before this commit murano used 'murano' as the name of it's dashboard.
This is too specific and contradicts with general practice of naming
dashboards after the names of the service.
This also prevents us from re-using the same dashboard in
murano-dashboard and app-catalog-ui

Targets bp: catalog-dashboard-reorg

Change-Id: I3df3865f6bf82626325e66120c408552260c7e2b
2016-09-06 12:46:46 +03:00
Jenkins d5b34bd861 Merge "Fetch class descendants in the dynamic_ui from glare" 2016-06-20 14:13:14 +00:00
Valerii Kovalchuk 551b73b84f Treat hyphen as a special character during password validation
Also added tests for password validation.

Change-Id: If30586c5e419871625e9d0c7389a14f40a559839
Closes-bug: #1589621
2016-06-14 13:47:38 +00:00
Kirill Zaitsev 2857c8f4a3 Fetch class descendants in the dynamic_ui from glare
Before this change whenever a murano-class dependency was specified in
the ui definition of a package, only packages that contained those
specific fqns were fetched from API, even though the information about
inheritance is available in the glare back-end.

With this change dashboard also fetches all the packages, that have
classes, that inherit from the specified package. This change also
alters the way absence of a package is handled. It's now specified as an
empty field with explanation, rather then a django message. This allows
having only partial dependencies and skipping optional dependencies
altogether

Change-Id: I6632f72ca260c26a116b3aa4608d9592d0f1cbce
Closes-Bug: #1585812
2016-06-06 10:29:54 +00:00
Valerii Kovalchuk 95c5651b11 Fix and simplify 'ClusterIPField'
ClusterIPField purpose is to validate IP to belong to env's subnet.
It is now impossible since environments are not assosiated with
particular subnets, at least on the creation stage.
We can leave simple validation of IP syntax in this field.

Change-Id: I50d809d6a99176f511e376ffbb6db1011303122c
Closes-bug: #1537066
2016-04-13 16:19:56 +03:00
Akihiro Motoki 81bffef47d Cleanup PasswordField.init and remove i18n-nonfriendly strings
PasswordField __init__ contains string concatenations
which make translations difficult.

This commit leaves default message in case there are no custom
validators and adds a simple generic help text for the password fields in
case there are custom validators and no help_text is supplied, since the
exact contains are difficult to obtain (in case of regexp validators).

Resulting strings marked for translation are clean and should allow i18n
team to have better control over the flow of translated text.

Co-Authored-By: Kirill Zaitsev <k.zaitsev@me.com>
Closes-Bug: #1556403
Change-Id: I64f9fc4006f44ba27e776a325ff664316f3ec2ec
2016-03-15 18:44:12 +03:00
Ekaterina Chernova f93bfa8f19 [DynamicUI] Apply user regex for the password field
Currently password field has strong regexp validator.
Previously it was not possible to application author
to soften password requirements.
This commit enables overwriting default validator with
a single 'regexpValidator' or multiple (dymanicUI special argument) -
'validators'.

Implements blueprint update-password-field

Change-Id: Id417ed71dcd737636439a2beb701751aa4ec0c12
2016-01-29 10:40:59 +03:00
Jenkins 1103077917 Merge "Control password field duplication" 2016-01-15 01:56:47 +00:00
Ekaterina Chernova b3bdf5f0aa Restore YAQL validators support
It was broken after YAQl release since YAQL expression
object contains recursive reference and deepcopy operation
failed. So need to copy such objects manually in
a separate function.

To prevent such kind of failures,
test of hot-based package was added.

Change-Id: If3fde7552d9657055aded73c4967fb6832c17536
Closes-Bug: #1498253
2016-01-14 13:51:18 +03:00
Ekaterina Chernova 4f2f120f15 Control password field duplication
Currently password is copied automatically in all the fields.
If application author does not want user to enter password
two times, he may forbid field cloning with 'confirm_input' option.

Targets blueprint: update-password-field

Change-Id: I6d5544e61d76af96a5dc10cec48bc994c83add76
2016-01-12 13:00:20 +03:00
Jenkins f81aa4e372 Merge "Introduced python3 support" 2015-12-23 20:22:22 +00:00
Kirill Zaitsev a212641ad7 Introduced python3 support
Replaces types with builtin functions
Replaces force_unicode with force_text
Adds six usage of .iteritems and .string_types where relevant
Updates setup.cfg entries

Targets blueprint: murano-python-3-support

Change-Id: I369f79c4258367974eb676cecb6eb1c941803503
2015-12-22 16:43:12 +00:00
Ekaterina Chernova 5cb14986ab Add maximum disk, vcpu and memory requirement
Sometimes it is necessary to limit the upper value in
a flavor requirement.
This commit enables this opportunity.

Change-Id: I41e71313a8539ba7e89fc2448d926b8edf22ce3f
Closes-Bug: #1525844
2015-12-21 12:50:22 +03:00
Ekaterina Chernova 9f652cc878 Migrate to new YAQL 1.0.0
All required changes were made: now global object is used,
arguments of registered functions were updated accordingly.

Also custom pickle objects were introduced to perform correct
serializations to keep data between requests.

Partially implements blueprint: migrate-to-yaql-vnext
Change-Id: If1e696dada7e0c2d4d593d5f27ca97f51604adfa
2015-08-25 18:15:11 +03:00
Nikolay Starodubtsev 1e8513c556 Switch to oslo_log in murano-dashboard
Change-Id: If454f698c8711f734d3220e82fc14331bd0d0661
Partial-bug: 1463093
2015-08-11 08:43:55 +00:00
Kirill Zaitsev 6bdc685fe7 Do not allow selecting images, that are not active.
Before a user could pick any image, that was marked with murano
meta-data, even images that are not currently active.
This change disables (greys out) such images in the select and adds
their title with current status (i.e '(saving)')

Change-Id: I6dfa56b987fa8643750f3e2bfb54226a7c05953a
Closes-Bug: #1480984
2015-08-05 19:53:26 +03:00
Kirill Zaitsev f847c50466 Enable hacking/flake8 rules
This commit enables and fixes previously disabled E and F rules:

* E111 indentation is not a multiple of four
* E113 unexpected indentation
* E265 block comment should start with '# '
* H236 Python 3.x incompatible __metaclass__, use six.add_metaclass()
* H238 old style class declaration, use new style (inherit from `object`)
* H405 multi line docstring summary not separated with an empty line
* H701 Empty localization string

Change-Id: Ie0af0d450f81cb5bf274192e6fdce3e41ccb7f88
Closes-Bug: #1478002
2015-07-29 23:58:07 +00:00
Alexander Tivelkov e11148e636 Add NetworkChoiceField to Dynamic UI
Sometimes a VM should be placed to an existing network rather then to a
new network created during deployment. While our workflows support this,
there is no way for the end user to select such a network in the UI.

This patch adds a new type of the field for Murano Dynamic UI:
NetworkChoiseField. This field provides a selection of networks and
their subnetworks as a dropdown pupulated with those which are available
to the current tenant.

When the user selects an item in this list the IDs of selected network
and subnet are returned by the control and thus may passed to the
engine along with the rest of the ObjectModel, so the newly created
instances join the specified net and subnet.

The control has a default option ("Auto"): if it is selected the
returned tuple contains Null, so the ObjectModel may be constructed in a
default way. This option may be disabled by the field parameter, so
package developers may use this field to oblige the user to select some
network.

Field has some other parameters, which allow to filter the available
networks: pick only the networks matching the specific regex, exclude
murano-generated networks or replace murano-generated names with
human-readable ones.

As this new field adds new functionality to the Dynamic UI platform,
it also bumps up a minor version of the format version to 2.1.

Implements Blueprint ui-network-selection
DocImpact

Change-Id: Ie256c36523c67f27e4cb0b7c9aeed76b2abd28af
2015-07-21 14:04:34 +03:00
Kirill Zaitsev b21538e2a3 Remove unused and unsupported table field
This commit removes any mention of table field from dynamic_ui and
removes floppyforms from requirements.

'table' field was introduced for MsSqlClusterServer service, that
changed significantly since then and does not use table field anymore.
See
https://github.com/murano-project/murano-app-incubator/blob/master/io.murano.windows.SqlServerCluster/UI/ui.yaml
for more details (even though the repository is deprecated).

Since no app available today uses this type of field, and no tests exist
for this type of field. There is no way to test, that it works correctly,
therefore it is very hard to transfer critical parts from floppyforms to
murano-dashboard.

'table' field depends on django-floppyforms, which is not
present in global-requirements, which is problematic and prevents us
from enabling proposal bot in murano-dashboard.

'table' field was never documented, so no documentation change is
required.

Change-Id: I638c722c2bdde411aaefa02f3d4027119de0e0bd
Closes-Bug: #1468342
2015-07-07 14:44:14 +03:00
Kirill Zaitsev 7f1069c118 Remove openstack.common modules
This patch removes unused openstack.common modules and replaces
versionutils with oslo_log.versionutils.
This fixes the gate issue partly, by removing openstack.common.log which
in some cases could override CONF object in horizon.

Change-Id: I94972726129c256d53377320b8b632afb56b8906
Closes-Bug: #1466332
2015-06-24 13:44:23 +00:00
Jenkins 9602d742b4 Merge "Escape initial values, that come from muranopl" 2015-06-04 13:00:46 +00:00
Kirill Zaitsev 199d37b362 Escape initial values, that come from muranopl
Currently help_text is rendered directly from muranopl code.
This commit escapes help_text, an other parameters, that are passed
directly to django forms from muranopl class definitions.

Also escapes initial values for object fields, that contain application
names, which come directly from users.

Change-Id: Iadd092669a13e99b0e9f0d062a1d1d9a630b00a1
Closes-Bug: #1453138
2015-06-01 15:06:08 +03:00
Kirill Zaitsev cd380da63d Mark BooleanFields as non-required in dynamic_ui
Due to the way django validates fields having a required=True fieild
almoust never makes sense. This would mean that user would not be able
to choose false for the boolean value, that the Field represents,
because django would raise an error, stating, that the field is
required.
This is especially true for fields, generated for HOT template-packages.
This patch sets required to False for dynamic_ui.

Change-Id: Ibc36017e37bb7df9f7bde2c53265237b21276fd6
Related-Bug: #1450536
2015-05-26 23:04:42 +00:00