Commit Graph

387 Commits

Author SHA1 Message Date
Ivan Kolodyazhny 1f80d94459 Use default Django test runner instead of nose
Nose has been in maintenance mode for the past several years. It has
issue with exit code [1] which leads to false positive results for our
seleniun-headless job.

This patch changes test runner for Horizon tests and does the following
things:

* Django test runner  executes test in a different order than Nose does.
  That's why we've got an issue with side-effect in
  horizon.tests.unit.tables.test_tables.MyToggleAction class. This patch
  adds workaround to it.
* Rename filename of test files to names starting with 'test_'
  so that the django test runner can find tests expectedly.
* '--with-html-output' option is temporary dropped and will be added in
  a following patch.
* Integraion tests is marked via django.test.tag mechanism which is
  introduced in Django 1.10
* 'selenium-headless' is broken now because we don't have geckodriver on
  gates, this patch makes it non-voting.
* 'tox -e cover' is fixed
* Remove @memorized decorator from
  dashboards.project.images.images.tables.filter_tenant_ids function.

[1] https://github.com/nose-devs/nose/issues/984

Depends-On: https://review.openstack.org/572095
Depends-On: https://review.openstack.org/572124
Depends-On: https://review.openstack.org/572390
Depends-On: https://review.openstack.org/572391

Related blueprint: improve-horizon-testing
Change-Id: I7fb2fd7dd40f301ea822154b9809a9a07610c507
2018-06-08 15:21:12 +03:00
Akihiro Motoki f3af02f20f openstack_dashboard: Move test files to match module structure
This commit relocates test codes in openstack_dashboard
according to blueprint relocation-test-codes.

Change-Id: I397a5a47fe9c1bf3a498c22056d924bf409c514b
2017-12-09 21:38:06 +09:00
Zuul b4fccffccc Merge "Drop Heat related code from horizon" 2017-12-09 10:27:43 +00:00
Akihiro Motoki eac3e7032a Drop Heat related code from horizon
Orchestration tab in the admin info panel needs a discussion.
It seems not to be covered by heat-dashboard yet.

blueprint heat-dashboard-split-out

Change-Id: I56e6edb1f2ac72e2f42d0e9f3291308e67f24cad
2017-12-05 07:38:55 +00:00
Akihiro Motoki 4c8a294aee API micro-version support for multiple features
Previously horizon micro-version support only supports one feature,
but there is a case where we need to support more than one feature
using micro-versioning. For example, "instance_description" and
"auto_allocated_network" in the server create operation both require
micro-version. This case was not supported previously.

This commit changes get_microversion() function to take a feature list
and looks up a micro-version which supports all requested features.

A known limitation is that we need to re-call get_microversion() with
different feature(s) if no micro-version which satisfies all requested
features is found and we would like to look up a micro-version which
supports a subset of the requested features. Most features are expected
in recent API versions, so I believe this would be a minor limitation.

Change-Id: I46f1c7fa1ddcf1dfac93d921cffaf3aa5ac011a7
Related-Bug: #1690433
2017-12-03 07:59:32 +09:00
Akihiro Motoki 9854147407 Fix broken nova console support
A patch of MKS console support replaces 'console' key into
'remote_console', but 'remote_console' key is only available
in Nova API version 2.6 or later. Horizon uses Nova API version
2.1 by default, so this change breaks the existing server console
support completely. This patch fixes it.

Change-Id: I656037511e0d80688df4b82fa8c77fe5c09402bd
Closes-Bug: #1735436
2017-12-01 00:07:31 +09:00
Zuul d46246d476 Merge "Make list_targets_by_instance look up IPv4 address as target" 2017-11-30 05:54:29 +00:00
Zuul 0b79c35007 Merge "Drop unused floating_ip_target_get_by_instance" 2017-11-30 05:54:26 +00:00
Zuul 520de94f75 Merge "FIP associate: Show only ports from a target server" 2017-11-30 05:44:13 +00:00
Zuul 865f793ff8 Merge "Add MKS console support" 2017-11-30 04:39:27 +00:00
yong sheng gong 1f41f29f0b Add MKS console support
Co-Authored-By: jinke <jin.ke@99cloud.net>
Co-Authored-By: yong sheng gong <gong.yongsheng@99cloud.net>

Change-Id: Id8ee4a28a09eb3d7f7598c507c0a4320a97cd01c
implements: bp support-mks-console-type
2017-11-29 21:06:38 -05:00
Lajos Katona ec299ff301 Trunks panel: edit button
Trunk edit is a 2-step workflow:
  * Basic trunk attributes
  * Subports selector transfertable:
      Selects many ports with segmentation details (optional)

In the port selector step reused and built on port allocator
transfertable from launch instance.

The easiest way to test is to take the whole change series by taking the
last change in it, then build devstack with neutron trunk support. Eg:

  local.conf:
  enable_plugin neutron https://git.openstack.org/openstack/neutron
  enable_service q-trunk

If you want to test this change in isolation you also need the following
Horizon config:

  openstack_dashboard/enabled/_1500_project_trunks_panel.py:
  DISABLED = False  # or just remove this line

Co-Authored-By: Bence Romsics <bence.romsics@ericsson.com>
Change-Id: I4a9f3bd710c9f6bc9ed942b107c6720865b1bc73
Partially-Implements: blueprint neutron-trunk-ui
2017-11-27 14:05:43 +01:00
Bence Romsics 1ab4b498f2 Trunks panel: create button
Trunk creation is a 3-step workflow:
  * Basic trunk attributes
  * Parent port selector transfertable:
      Selects a single port (mandatory)
  * Subports selector transfertable:
      Selects many ports with segmentation details (optional)

In the port selector steps reused and built on port allocator
transfertable from launch instance.

The easiest way to test is to take the whole change series by taking the
last change in it, then build devstack with neutron trunk support. Eg:

  local.conf:
  enable_plugin neutron https://git.openstack.org/openstack/neutron
  enable_service q-trunk

If you want to test this change in isolation you also need the following
Horizon config:

  openstack_dashboard/enabled/_1500_project_trunks_panel.py:
  DISABLED = False  # or just remove this line

As long as the 'trunk' API extension is available (openstack
extension show trunk) the panel should automatically appear under
Project/Network/Trunks.

To try the 'inherit' segmentation type the subports must be ports of
vlan type provider networks.

Co-Authored-By: Lajos Katona <lajos.katona@ericsson.com>
Co-Authored-By: Elod Illes <elod.illes@ericsson.com>
Change-Id: I663a7e0158335155fe11f0fc40d9fa86bf984ae0
Partially-Implements: blueprint neutron-trunk-ui
2017-11-27 14:05:43 +01:00
Zuul 51abdbdd46 Merge "Refactor FIP code to use FloatingIpTarget properly" 2017-11-22 03:59:43 +00:00
Zuul 2c079f423b Merge "NaNJSONEncoder should be used in api "cinder/tenantabsolutelimits"" 2017-11-21 18:35:22 +00:00
Akihiro Motoki 07e2e0af92 Make list_targets_by_instance look up IPv4 address as target
Previously list_targets_by_instance extracts the first IP address
of a network port. There is no guarantee that the first IP address
is IPv4 address. It may be an IPv6 address, but IPv6 cannot be used
as a target of floating IP.

Closes-Bug: #1725656
Change-Id: Ibd958dde42731aec2a2d80c0d172b7bfbb5c954e
2017-11-18 00:03:00 +00:00
Akihiro Motoki cd9a14d293 Drop unused floating_ip_target_get_by_instance
floating_ip_target_get_by_instance is no longer used anywhere.
floating_ip_target_list_by_instance covers this functionality,
so there is no reason to keep this method.

Related-Bug: #1725657
Change-Id: I166acdcd555ba001b5802397b0092cb8065f9f27
2017-11-18 00:03:00 +00:00
Akihiro Motoki d14fbc849e FIP associate: Show only ports from a target server
Previously when associating an FIP to a server, neutron ports which
do not belong to a target server were also shown in the target list.
It is clearer if only neutron ports connected to a target server
are shown. This commit changes the logic to lookup FIP targets to
achieve this.

Closes-Bug: #1630412
Change-Id: I9901b54e125b6bf09df86537c8308b2bfb1499f2
2017-11-18 00:03:00 +00:00
Akihiro Motoki 7961c6a84f Refactor FIP code to use FloatingIpTarget properly
FloatingIpTarget was introduced but it was used partially.
This commit clean up the remaining logic of FIP target ID calculation.

Related-Bug: #1725657
Change-Id: I4b93b9a7a3977b042bb9c3200923c5c2fa84476d
2017-11-18 00:03:00 +00:00
Shu Muto e7f22178b2 Add delete action for key pair
This patch adds delete actions for angularized key pair panel.

Change-Id: Iccb5014add0e19d6154bd6261d97a83b2ecdf32f
Partial-Implements: blueprint ng-keypairs
2017-11-01 14:53:04 +09:00
liyingjun 2161b91264 [Micro version] Support description for instance
In Nova Compute API microversion 2.19, you can specify a “description”
attribute when creating, rebuilding, or updating a server instance. This
description can be retrieved by getting server details, or list details
for servers, this patch adds support for this attribute for instance in
horizon.

Change-Id: Ic9217234021d236aee8295915f1a9c3c544396b0
Implement-blueprint: support-description-for-instance
2017-10-26 22:36:00 +08:00
Ivan Kolodyazhny e94992f025 Switch Cinder-related tests to mock
It's a first patch in the series mox => mock migration.

 This patch changes mox to mock for the following test modules:
* openstack_dashboard/test/api_tests/cinder_tests.py
* openstack_dashboard/test/api_tests/cinder_rest_tests.py

Change-Id: Ic7283f139855c0017b840e8136ded4f05abcde66
Partially-Implements: blueprint mock-framework-in-unit-tests
2017-10-23 18:43:08 +03:00
Zuul 1fdfcf52e9 Merge "Fetch Cinder availability zones list for volume creation" 2017-10-23 13:34:55 +00:00
Ivan Kolodyazhny b9972f73b0 Fetch Cinder availability zones list for volume creation
We have to fetch and show Cinder availability zones list during volume
creation and volume creation from image.

Change-Id: I1c8746870d94c183f5ef510c1ce09b3fc9c84220
Closes-Bug: #1721286
2017-10-23 14:25:04 +03:00
Trygve Vea 9d5be5251f Hide IPv6-addresses when assigning floating IP addresses
A floating IP can only be associated with an IPv4 address, so we should
not show IPv6 addresses in the list of ports when assigning floating IP
addresses.

Change-Id: I7b39a263445204a9efbc8fe113cc79146d9bee8c
Closes-Bug: #1703360
Closes-Bug: #1724393
2017-10-20 21:30:27 +00:00
Cindy Lu 924fb68645 Add REST APIs for Keystone Group
This patch adds REST APIs (read, create, edit, delete)
for Keystone Group.

Change-Id: I9ca3b509bcd6ab3f255094fa367f9b236caf13da
Partially-Implements: blueprint ng-groups
Co-Authored-By: Shu Muto <shu-mutou@rf.jp.nec.com>
2017-10-10 13:35:52 +09:00
Shu Muto 194c881396 Angularize Key Pair Details
This patch adds Angularized details view for Key Pair.
Also, added new filter 'mediumDate' that format date as follow:
e.g) Feb 3, 2001 4:05:06 PM

Change-Id: I1eaead66a582c15442b28ae83fb1c573a46b0f43
Partial-Implements: blueprint ng-keypairs
2017-09-28 16:57:49 +09:00
Akihiro Motoki 61ad9f69bd Fix a bug to unable to retrieve ports when no trunk ext
When neutron trunk extension is not enabled, we cannot retrieve
network ports for a new instance. The current version of
port_list_with_trunk_types assumes the trunk extension is always
available, so if it is not enabled we cannot retrieve network ports.
This commit changes the logic to check whether the trunk extension
is enabled and if not it does not retrieve trunk information.

Change-Id: I2aa476790820f9512fe4728e0a806bd543021b0b
Closes-Bug: #1717893
2017-09-19 18:01:52 +00:00
zhangdebo1987 de37fc1024 NaNJSONEncoder should be used in api "cinder/tenantabsolutelimits"
In api "cinder/tenantabsolutelimits", result maybe contains Infinity values,
but Infinity values are not supported by JSON standard, so NaNJSONEncoder is
needed here.

Change-Id: I750637e3214ad46a8b29e1ad565870cdcb827fe1
Closes-bug: #1714417
2017-09-15 06:10:00 +00:00
Jenkins b624d2f0aa Merge "TrunkPort, Horizon workflow: launch instance" 2017-09-07 09:00:39 +00:00
Jenkins 5428b96c2c Merge "Get all needed instances for volumes attachments at Admin->Volumes" 2017-09-05 11:53:52 +00:00
Ferenc Cserepkei 748d9860bb TrunkPort, Horizon workflow: launch instance
Ethernet trunks (network interfaces having a vlan tag) cannot be used
as a boot interface. This is a DHCP/PXE limitation. So instead the
interface without the vlan tag can be used. In neutron's nomenclature
they are the trunk parents. It is also an OpenStack limitation. Subports
should not be passed to 'openstack server create --nic ...'. But if you
do, there's no clear error message about it. Please see Armando's
analysis here why:
https://bugs.launchpad.net/neutron/+bug/1636485/comments/9

The server part of this patch signals port kind (i.e. plain, trunkparent,
trunksubport) so the launch widget can easily filter out trunksubports,
what are not suitable for boot interface.

Change-Id: Ie3a6710eeffefcb472c569898d0f1f1554e599f7
Partially-Implements: blueprint neutron-trunk-ui
Signed-off-by: Ferenc Cserepkei <ferenc.cserepkei@ericsson.com>
2017-08-31 21:33:56 +00:00
Akihiro Motoki 15d996f7e4 Allow admin to create port on networks of different projects
Due to the change in the neutron API wrapper [1],
admin cannot create a port on networks owned by different project.
This is because api.neutron.network_get returns subnet detail
(Subnet object) only when project_id matches that of a target network.
This commit changes the logic to try to retrieve subnet detail first.
The condition is not simple and it looks wise to let neutron decide it.

The error reported in the bug also happens in the Port Create form
in the project dashboard if a user tries to create a port on an
external network. To handle the situation, handle() in CreatePort form
honors whether subnet detail is retrieved or not by checking a subnet
information is an instance of api.neutron.Subnet class.
This is a bit tricky but considering the current policy for create_port
I believe it is a good compromise.

Also fixes the wrong initial value of 'specify_ip' field of CreatePort
form. The initial value should be one of choices or None. Otherwise,
when 'specify_ip' field is hidden, an error message is returned
(though the message is not visible in the form), a user cannot submit
the form and the form is displayed continuously....

[1] commit 803209e237

Closes-Bug: #1645708
Change-Id: I6aae0a29eedebc920247912fec0729bf47cda002
2017-08-21 10:30:12 +00:00
Akihiro Motoki 0c1e179b3c api.rest.neutron: Ensure dict is passed to api.neutron args
Some functions in api/neutron use @memoized decorator,
but @memoized decorator cannot handle request.GET (an instance of
QueryDict) because a weakref to WSGIRequest is not hashable.
(Note that @memoized decorator can handle a dict itself)

What we actually need is the content of request.GET.
By using .dict() method we can ensure arguments which
@memoized can handle are passed to api.neutron functions.

This pattern is used only in api.rest.neutron and
not used in other codes.

Closes-Bug: #1706348
Change-Id: Ibb38ad1d95af1cd90a1fedd834602f444010c151
2017-08-08 16:58:27 +00:00
Jenkins adb2583e90 Merge "Fix missing volume name on launch instance modal" 2017-08-02 21:06:16 +00:00
Lajos Katona da92f24bc2 Trunks panel: details for trunks and subports
Add details link to the trunk panel to show details of the given trunk,
like the subports list, with port_id and segmentation details.

Co-Authored-By: Bence Romsics <bence.romsics@ericsson.com>
Change-Id: I9000e2907a8f188d5e72e36818b7171f35158eb9
Partially-Implements: blueprint neutron-trunk-ui
2017-07-27 10:48:55 +02:00
Ying Zuo b00f8a603a Fix missing volume name on launch instance modal
The Volume object passed back from cinder doesn't have the name
for volumes created with an instance. It should be passed in to
api.cinder.Volume to get the name properly.

Change-Id: I2a812c898f601c741f232419f96bf93f3965bf81
Closes-bug: #1702966
2017-07-23 20:21:32 -07:00
Ivan Kolodyazhny 3a99499ba0 Get all needed instances for volumes attachments at Admin->Volumes
Nova server_list() wrapper needs to receive an explicit `all_tenants`
boolean flag in order to request instances for _all_ tenants -
otherwise while rendering Admin->Volumes table Django will request
missing instances (to get their names for volume attachments) one by
one, thus significantly increasing response time.

This patch adds check if all_tenants in search_opts and add it to
the search else uses tenant_id in the search_opts.

Co-Authored-By: Dmitry Sutyagin <dsutyagin@mirantis.com>
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I4761d7da15036b69619649871aef91e1799ee385
Closes-Bug: #1508568
2017-07-13 20:35:21 +03:00
Jenkins 83c77d152b Merge "Use flake8-import-order plugin" 2017-07-03 20:14:35 +00:00
Akihiro Motoki e6b78f92f2 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
This flake8 plugin is already used in tempest.
It enforces loose checking so it sounds good to use.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Change-Id: I8ccd05eb70350a2441cc2a4d1eafc09ee690b83b
2017-07-03 08:02:23 +00:00
Akihiro Motoki 385870317a Split out FWaaS dashboard
Implement blueprint split-out-neutron-xaas-dashboards
Change-Id: Ieaca88dbe28cc2330d9b333082ff7e92c91e8639
2017-06-27 14:20:03 +00:00
Akihiro Motoki 1d6a217da1 Split out VPNaaS dashboard
Implement blueprint split-out-neutron-xaas-dashboards
Change-Id: Ib304ddef381d80011f7030fdd5049aab0e901ae6
2017-06-27 14:20:03 +00:00
Jenkins 4a882c14b9 Merge "Show security groups in Port detail page" 2017-06-20 12:16:12 +00:00
Jenkins 17e40e7ac0 Merge "Trunks panel: item and batch delete" 2017-06-20 11:47:47 +00:00
Jenkins f5b2561a09 Merge "Use POST not GET for keypair generation" 2017-06-16 09:00:05 +00:00
Bence Romsics 9120b40038 Trunks panel: item and batch delete
Add delete buttons to the Project/Network/Trunks panel. There is one
button per each trunk item deleting only that trunk. Plus a select and
delete many trunks at once by checkboxes and then delete all selected.
The usual extras (confirmations and toast notifications) are included.

Change-Id: Ie88e169072a563fa238bf870664b71aa7f2a883d
Partially-Implements: bp/neutron-trunk-ui
2017-06-16 09:11:40 +02:00
Akihiro Motoki 21e4222f61 Show security groups in Port detail page
Closes-Bug: #1677535
Change-Id: I3558b0354dfd91fa3b30afee9263e8bf90482ebd
2017-06-16 00:16:18 +00:00
Ying Zuo ddfa667d02 Add instance locked status on instances table
Added a column to show the locked status on project/admin instances table.

There will be a locked or unlocked icon with help tooltip if nova 2.9 or
above is used. See openstack_dashboard/api/microversions.py

Added the locked field on project/admin instance details panel.

Change-Id: If31ae281d2782c71cd6112f3bd6228647a6130e4
Closes-bug: #1593903
2017-06-14 20:00:56 -07:00
Beth Elwell 12fe351823 Adds basic angular QoS panel to Horizon
This patch adds the QoS panel which displays Neutron QoS policies.
This patch allows read only view of the policies, displaying the name,
id, description and shared status of each policy. Policy actions and
rules to be added in follow-up patches.

To test:
Neutron's QoS plugin must be enabled in your setup.
To enable the QoS plugin in devstack please add the following lines
in the local.conf

    enable_plugin neutron git://git.openstack.org/openstack/neutron
    enable_service q-qos

and rebuild your stack (./stack.sh).

Create some qos policies via CLI (neutron qos-policy-create policy1).
now you can list the policies using this patch.

Based on initial commit: https://review.openstack.org/#/c/247997
Co-Authored-By: Masco <mkaliyam@redhat.com>
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>

Change-Id: If46aeb04879d91a1a9305a94a23cecea2041d378
Implements: blueprint network-bandwidth-limiting-qos
2017-06-13 16:36:29 +01:00
Matt Borland d07fedc45f Use POST not GET for keypair generation
This patch fixes the Cross-Site Request Forgery (CSRF) attack against
the keypair generation pages:
- HORIZON_URL/project/key_pairs/PAIRNAME/generate/
- HORIZON_URL/project/key_pairs/PAIRNAME/download/
These pages exposed creating and/or overwriting a keypair with a given
name via a CSRF attack.

This patch closes these holes by using only POST-based keypair creation,
and exposing the keypair in the contents of a modal dialog instead of a
download, which ultimately requires a GET.  It uses the same client-side
features for both the Launch Instance keypair creation and Compute / Key
Pairs panel.

Closes-Bug: 1575913
Change-Id: Ie5ca28ff2bd806eb1481eba6f419b797b68856b6
2017-06-08 11:13:31 -07:00