Commit Graph

19 Commits

Author SHA1 Message Date
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
Thomas Goirand 81195976cd Django 3.2 support
This patch fixes a few issues regarding Django 3.2 support.

Closes-Bug: #1944523
Co-Author: Daniele Mazzocchio <daniele.mazzocchio@infomaniak.com>
Co-Author: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I1d906e2d910b25a79acfc13b7f3d890476ee301e
2021-09-23 02:23:20 +09:00
Sean McGinnis 22efa8fd7f Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I5ad2c7a44dee2e19ab2576f206c69d94126a22b1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
2020-04-20 03:54:03 -07: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 4985bfa010 Switch test runner to django default runner
nose is not actively maintained now and Django default test runner
seems to have enough features.

Horizon test setting no longer depends on nose and related stuffs.
This commit cleans up nose related dependencies.
The change was made in horizon Rocky-3,
so horizon 14.0.0.0b3 is required at least.

And murano-dashboard using unittest instead of testtools.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I419e0e166ea88c3ab1203f35ffa00928cf94acb1
Depends-On: https://review.openstack.org/599156/
2018-10-09 02:22:08 +00:00
wangqi e98cd6cd0c Replace assertRaisesRegexp with assertRaisesRegex
assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2
For more details, please check:
https://docs.python.org/3/library/
unittest.html#unittest.TestCase.assertRaisesRegex

Change-Id: Ib5e52abde4cd642c3d214d3e29e8c55843983f2d
2018-04-23 02:45:22 +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
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
gecong1973 7aa3c6220d Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)
assertGreater provides a nicer error message if it fails.

Change-Id: I58ab46e7e5829e3fcfeb4d20dd208a4eb7a3b483
2016-11-24 14:23:09 +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 8bb47844ee Increase unit test coverage for muranodashboard Dynamic UI Fields.
Implements bp: murano-unit-test-coverage

Change-Id: I6288c37d8706998ea2a90832eff1ecadbaf19ba0
Related-Bug: #1638928
2016-11-07 09:34:50 -05:00