5685 Commits

Author SHA1 Message Date
Zuul
6f03708486 Merge "Drop the usage of unicode prefix from unicode strings" 2021-02-17 14:59:31 +00:00
Zuul
ef034dda00 Merge "Add pagination to Network Ports table in Launch Instance wizard" 2021-02-17 14:45:35 +00:00
Andrew Bogott
b4fd4c2e76 Server tabs: add policy enforcement for tab display
We have nova policies for all of these so should observe them. Otherwise
if a user e.g. doesn't have rights to view the console log of a VM they
will get an error every time they click on an instance name.

Change-Id: I78bb67621c4c0aea0a06bf10e9fe07a618ce8766
2021-02-12 14:52:25 -06:00
YuehuiLei
87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Andrew Bogott
9ad5542486 security_groups panel: Add neutron policy enforcement
Bug: 1915308
Change-Id: Id6b802faba3f5260ce084b8f8bafedc6324d780d
2021-02-11 19:14:26 -06:00
Zuul
cebcbe8a49 Merge "Set Admin Password at NG Launch Instance dialog" 2021-02-10 01:33:04 +00:00
Zuul
66721634d4 Merge "Add option to set MTU on network creation" 2021-02-10 01:06:36 +00:00
Tatiana Ovchinnikova
c2d3f61d4d Set Admin Password at NG Launch Instance dialog
This patch allows to set admin password at Angular Launch Instance
dialog when 'can_set_password' is true in OPENSTACK_HYPERVISOR_FEATURES.

Closes-Bug: #1439905
Closes-Bug: #1609777

Change-Id: I3307521df524da30b910f0001165cefa2be6c8bb
2021-01-22 10:45:34 -06:00
Tatiana Ovchinnikova
b65700a865 Show project name at launch instance dialog
It is easy enough to create instances in the wrong project.
This patch displays project name at launch instance dialog.

Closes-Bug: #1895588

Change-Id: Ied681bc3d1b4213bd6bacb3042b377ec2ac10855
2021-01-19 15:11:47 -06:00
Tatiana Ovchinnikova
76f196d1ed Add option to set MTU on network creation
Setting MTU is now available for network creation on project and
admin panels.

Closes-Bug: #1549636

Change-Id: I384a6b78eaf75d9c0373cdfa51c3ea5f53f63e6b
2021-01-19 12:32:15 -06:00
Zuul
f0bd09e69d Merge "Fix full text search at containers page" 2021-01-14 00:34:48 +00:00
Tatiana Ovchinnikova
0f64278607 Fix 'requires_keypair' impact on NG Launch Instance dialog
Although Key Pair step at NG Launch Instance dialog automatically picks
a key pair, it's better to make key pair step as required explicitly when
'requires_keypair' is set to true in OPENSTACK_HYPERVISOR_FEATURES.

Closes-Bug: #1765024

Change-Id: I28b0f54fed0dac86e300fb9ed65c16e0dd2aef36
2021-01-05 13:55:01 -06:00
Tatiana Ovchinnikova
5c45c8825e Add expectations to identity specs
The last bunch of "spec has ho expectations" warnings is fixed
for the latest Jasmine. The option failSpecWithNoExpectations
is set to true now.

Related-Bug: #1894127

Change-Id: I87d6a3e0a21eb8f3e5a548d7fdd0ae01bbda54e1
2020-12-18 10:22:57 -06:00
Tatiana Ovchinnikova
b532943a31 Update devDependencies in package.json
This patch updates outdated JavaScript dev dependencies.

The latest Jasmine version makes nested beforeEach and unhandled
promise rejection fail, this was fixed.

Also, the latest Jasmine version runs tests in random order by default,
random is set to false for now to prevent tests failures.

Finally, the latest Jasmine version supports a new configuration option
failSpecWithNoExpectations. By default, this option is set to false and
Jasmine reports specs that have no expectations as passed. Setting this
option to true tells Jasmine to report specs without as expectations as
failed. For now, it is set to false for openstack-dashboard tests, this
should be changed in future.

Change-Id: I04d5c3ce7f7e0a9a38251e975b68bfa1998e556f
2020-12-17 12:21:31 -06:00
Zuul
6b702f4a1c Merge "Drop the usage of nova extensions in JavaScript code" 2020-11-18 13:33:11 +00:00
Zuul
d27160096b Merge "Drop the usage of nova extensions in python code" 2020-11-18 13:33:09 +00:00
Zuul
ff1af2f1a4 Merge "Non-api filters not working with admin instance tab" 2020-11-18 13:33:06 +00:00
Zuul
150c029306 Merge "On the create instance from, when the image name is empty, show id" 2020-11-18 13:21:12 +00:00
Zuul
05e232c03a Merge "Refactor quota related unit tests" 2020-11-18 10:13:54 +00:00
pengyuesheng
a8158f6c31 On the create instance from, when the image name is empty, show id
Change-Id: I4ac734e0fb4ac3151ff56fa2c53d3071cdb9131d
Closes-Bug: #1853551
2020-11-03 15:37:24 -06:00
Tatiana Ovchinnikova
40acf5b75c Fix full text search at containers page
Containers page uses the standard Magic Search filtering, however its
full text search option doesn't work.
This patch makes the filtering work properly with full text search.

Closes-Bug: #1902610

Change-Id: Ie784d187c89eba1a2673ecafd72e903115a264d3
2020-11-02 20:22:42 -06:00
vinay_m
6b79cdcc1b Non-api filters not working with admin instance tab
The issue was that the filtering opts like project_name, image_name,
flavor_name that are not supported by nova API (non-api filters) do
not work expectedly. These filters are mapped to their IDs [1], but
an instance list retrieved before resolving non-API filters is used [2].
This commit changes the logic to resolve non-API filters first and
then retrieve instances using the updated search_opts.

Note that the image list is handled a bit specially. If 'image_name'
is specified as a filter, we retrieve a corresponding image detail
first before fetching instances to resolve the image name into its ID.
Otherwise, we retrieve images only related to instances retrieved
and this happens after retrieving instances.

[1] f90c3cd501/openstack_dashboard/dashboards/admin/instances/views.py (L166)
[2] f90c3cd501/openstack_dashboard/dashboards/admin/instances/views.py (L154)

Closes-Bug: #1888490
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Id43adbd44778d3375c0d49da3f7530cbb99e16fe
2020-10-27 20:07:57 +09:00
Akihiro Motoki
3c6286a9e9 Drop the usage of nova extensions in JavaScript code
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (2/3)

References to nova extensions are cleaned up.
The logic to fetch nova extension list is finally dropped.

Change-Id: If4876634276eff37ab0a18a49e6e97851d41911b
2020-10-27 20:00:45 +09:00
Akihiro Motoki
c45cc6b1c5 Drop the usage of nova extensions in python code
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (1/3)

All references of nova extensions in the python code are cleaned up.
Note that the API layer is not touched yet as it is used by the
JavaScript side.

Change-Id: I66cd0a9629253a6462aace9902ef8200b94b2a21
2020-10-27 20:00:45 +09:00
Zuul
f90c3cd501 Merge "Use python3-style super()" 2020-10-27 04:42:53 +00:00
Zuul
19c90c1ad0 Merge "pylint: Fix unnecessary-comprehension warning" 2020-10-26 17:53:05 +00:00
Zuul
c8d92aebb1 Merge "pylint: Address no-else-return warning" 2020-10-26 11:15:25 +00:00
Akihiro Motoki
b89c705164 Refactor quota related unit tests
openstack_dashboard/dashboards/project/floating_ips/tests.py:
The floating IP panel implementation calls
openstack_dashboard.usage.quotas.tenant_quota_usages, but
its unit test mocks functions called inside tenant_quota_usages.
tenant_quota_usages itself should be mocked.

openstack_dashboard/test/unit/usage/test_quotas.py:
Mocked methods were not verified test_tenant_quota_usages_non_legacy.
Verifications for called methods are added.
Mocking floating_ip_supported is dropped as it is not called and
there is no need to mock it.

Change-Id: Iad66c882738fd90eb6dd6de3df96459c10a29aa2
2020-10-26 17:20:52 +09:00
Tatiana Ovchinnikova
35e8888b6c Add pagination to Network Ports table in Launch Instance wizard
The most elegant way to add pagination is to refactor the table using
<hz-dynamic-table> which already contains pagination instead of wiring
it to the existing table framework.
This solution adds the pagination and makes the code more readable.

Partial-Bug: #1859423

Change-Id: I3816d5b9c69701707d044018a8b45174eb901b3a
2020-10-21 12:38:09 -05:00
Zuul
abcbb0dea8 Merge "pylint: Address no-else-continue/no-else-raise warnings" 2020-10-19 18:39:47 +00: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
Zuul
e3dd5a02d9 Merge "Make text download and load groups tests work" 2020-10-12 14:03:01 +00:00
Walter Doekes
612942bdf7
users: Correct lock_password status visibility (Yes/No) in user details
Before this change, it would always say No, regardless of actual
setting.

Change-Id: Ib30d818ecae7b8edd33e94ad2c3c0e2ad8e01822
Closes-Bug: #1897269
2020-10-06 10:13:07 +02:00
Zuul
64d42ed9e4 Merge "Drop remaining glance v1 related code" 2020-10-05 07:43:46 +00:00
Akihiro Motoki
74df97f57c pylint: Fix unnecessary-comprehension warning
'unnecessary-comprehension' warning is emitted when
unnecessary use of a comprehension is found.

classes attribute in Action can be a tuple,
so we need list() to ensure it is a list before adding 'disabled'.
I think it is time to introduce a method in Action class or somewhere
but it should be handled separately.

Change-Id: I16a98d56b6d0bd0af234b00735c6ed576620df7e
2020-09-27 12:44:16 +09:00
Akihiro Motoki
692778f8cf pylint: Address no-else-return warning
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.

Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
2020-09-27 12:44:16 +09:00
Akihiro Motoki
b67ad564c4 pylint: Address no-else-continue/no-else-raise warnings
Change-Id: I1d44c1bf564cf02908113a42b98e06057e993ec7
2020-09-27 12:44:16 +09:00
Zuul
c44e651589 Merge "Add Unit Test for cinder-user-facing messages" 2020-09-25 10:23:29 +00:00
manchandavishal
82dfce9f65 Add Unit Test for cinder-user-facing messages
This patch is a follow-up patch of
64db185c7942721d32308245b1527f2367dceb21
which adds unit tests for the change.

Add message_level to cinder message test data.
Add third cinder message to make tests more robust.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I6be88fbacf998a2ba36fea5a776cd4215cdaba0f
2020-09-25 10:51:46 +09:00
Zuul
752d55ff68 Merge "Show all os-extended-server-attributes" 2020-09-24 13:15:12 +00:00
Zuul
d8f98d8203 Merge "Fix: Page crashes on instance confirm resize" 2020-09-24 10:43:09 +00:00
Ivan Kolodyazhny
d403b31d70 Show all os-extended-server-attributes
Patch I0cfe9090e8263f983fa5f42f42616a26407be47a adds hypervisor hostname
to the instance details view. This patch adds the rest of instance
attributes allowed by 'os_compute_api:os-extended-server-attributes'
policy.

Change-Id: Id39ee14e3054422a96248f8cdd0a5bf07c27f2fc
Closes-Bug: #1874273
2020-09-24 18:48:15 +09:00
pedh
a4a549a181 Fix: Page crashes on instance confirm resize
Add error handling to instance confirm/revert resize methods.

Change-Id: I128049091f38e8db3c1524a5c4cb932f3e809714
Closes-Bug: #1882918
2020-09-24 06:56:49 +00:00
Zuul
fb13427c78 Merge "Make identity tests work" 2020-09-24 02:58:30 +00:00
Tatiana Ovchinnikova
533892f080 Make text download and load groups tests work
Currently "then" callback functions for these tests aren't called since
digest cycles were never triggered. Jasmine Spec Runner marks them 'passed'
only adding "SPEC HAS NO EXPECTATIONS" into their names.
This patch triggers a digest by calling a scope's $apply functions in a
correct place, deals with timeout properly and makes the tests work.

Closes-Bug: #1894127

Change-Id: I00acc4b13fa0cc05b8c6ccd2024084527562f001
2020-09-22 14:35:17 -05:00
Zuul
5056b9bbe6 Merge "Make getPorts and setBreadcrumb tests work" 2020-09-14 22:39:23 +00:00
Akihiro Motoki
6ba506e281 test: use safer way to override settings
Django provides safer ways to override settings.
We should avoid direct replacement of existing setting.

Change-Id: I1fbcb79d18baaae037536b180989cf69c198fa7d
2020-09-13 09:47:50 +09:00
Akihiro Motoki
b79ebc85b0 Drop remaining glance v1 related code
We dropped glance v1 support in ussuri.
glance v1 related tests still exist in the project instance test.

Change-Id: I3079c579a1f3d42e5b02fc224f7677ea86583a7e
2020-09-12 10:58:20 +09:00
Tatiana Ovchinnikova
91298f9b5f Make getPorts and setBreadcrumb tests work
This patch adds expectations to the tests and make them work.

Partial-Bug: #1894127

Change-Id: Ic22033343c344a42148b0ec5a31bccb1e08478c6
2020-09-11 12:58:39 -05:00
Zuul
79e505520f Merge "Add cinder-user-facing messages" 2020-09-10 18:04:09 +00:00