Commit Graph

83 Commits

Author SHA1 Message Date
Richard Jones 46ad19dbf0 Refactor Project Volumes stand-alone panel
Note that there was state leaking from one of the existing
tests that was relied upon in other tests and moving that test
in the run order caused the others to fail. All related tests
have been altered to not leak state.

Change-Id: I972bc5650fa77044de8a027f570cf2cb41febef8
Implements: blueprint reorganise-volumes
2017-03-06 15:50:09 +11:00
Lingxian Kong c33b0840cb Only get detailed info for Nova servers when necessary
Horizon will get all servers from Nova in different several places,
but sometimes it only need ID and name instead of all the related
information of servers. novaclient already support 'detailed=False'
param for servers query.

Horizon page loading performance can also be improved with this patch.

Closes-Bug: #1661423
Change-Id: Ic4cc95cb4eaed0461a22ab1045fa83ba5a5e9ce4
2017-02-03 12:03:22 +13:00
Cao Xuan Hoang f8851fbdd6 Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)
assertGreater provides a nicer error message if it fails.

Change-Id: Id9a2e11e21cca87bb4ef23ced5bbbae6817dba73
2016-12-09 11:11:41 +07:00
Jenkins 35fdc05540 Merge "Fix compatibility issues with Django 1.10" 2016-09-20 19:44:01 +00:00
Rob Cresswell 3488ab3d40 Fix compatibility issues with Django 1.10
Required modifying our URL pattern decorator to
be compatible with the slightly different callback
attribute mechanism in 1.10

Modified breadcrumb structures to always be 2-tuples
as tuple unpacking is now strictly enforced in 1.10

Also made the following things changed in Django 1.10.
- fixed the now-deprecated TEMPLATE_DEBUG.
- Caught up with Request context change
- SimpleTestCase.urls is removed in 1.10.
  ROOT_URLCONF needs to be used instead.

Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Akihiro Motoki <motoki@da.jp.nec.com>
Change-Id: I59cbd8bff117813258539ed0724fe89a9f5b77ee
Implements: blueprint dj110
2016-09-20 12:29:16 +01:00
Jenkins 61439e8ccc Merge "Replace 'assertTrue(a in b)' with 'assertIn(a, b)'" 2016-09-20 10:52:34 +00:00
shizhihui 312731ab4c Replace 'assertTrue(a in b)' with 'assertIn(a, b)'
Supplement the patch:https://review.openstack.org/#/c/364652/

Change-Id: I6890d7f5aff751ddfad86fc954146cc5ac102ac8
2016-09-13 13:13:00 +08:00
Julie Pichon cf0aac9400 Support for Glance v2
Implements wrappers necessary for Horizon to work with either Glance
v1 or v2 and removes the dependency on the Glance v1 endpoint.
Handles the differences between setting properties with v1 and v2 and
restricts some Glance functions that aren't supported in v2.

Implements blueprint: horizon-glance-v2
Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com>
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Co-Authored-By: Liuqing Jing <jing.liuqing@99cloud.net>

Change-Id: Icca91c53eabf18c3109b3931ed53f70eaaaa0e56
2016-09-12 11:16:33 -07:00
Timur Sufiev e5057c6584 Correcting form_invalid get_context_data call
This change corrects a bug where the form_invalid call was
not calling the correct instance of get_context_data.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Closes-bug: #1598302
Change-Id: I5391e86dc85c48a601d6417fd7cd1ecf007b7196
2016-08-01 16:33:04 +00:00
Jenkins 59a56d3640 Merge "Use breadcrumb nav across Horizon" 2016-05-07 03:29:03 +00:00
Jenkins 77e372c7f6 Merge "Add download button for volume transfer creds" 2016-05-06 13:57:08 +00:00
Rob Cresswell d5b24d7b97 Use breadcrumb nav across Horizon
We've added breadcrumbs to the Details pages, but its a pretty
inconsistent experience. This patch adds breadcrumbs to the base
template, making the breadcrumbs consistent across all pages; this will
be useful when the side nav is hidden for responsive design. This patch
also makes the breadcrumbs on the detail pages behave better with
theming.

- Made the detail header and actions avoid using floats
- Moved breadcrumb truncating to the front end, so that it can be
  customised easily via CSS
- Manually added breadcrumb for ngcontainers page
- Removed overly specific HTML check from Key Pair Details test
- Fixed <dt> alignment on Key Pair Details page

Closes-Bug: 1554812
Partially-Implements: blueprint navigation-improvements
Change-Id: Ibcd4c369b5d8ad62f7c839c0deeaefc750677b40
2016-05-05 23:12:59 +00:00
David Lyle 5d6003971f Fix tests broken by novaclient 4.0.0 release
The release of python-novaclient 4.0.0 removed both volume_types
and volume_snapshots from the v2 namespace. Both of these data types
are supplied by cinder, but the Horizon test data was still populating
them in nova test data and the tests were using the nova values.

This patch removes the missing namespace references and replaces
the mocked test data with those mocked for cinder.

Additionally, the change exposed a rather broken test in the QoS
for volume_types test suite. This test has been fixed and improved
to exercise more branches.

This fix will unblock the gate for Horizon.

Closes-Bug: #1572246
Change-Id: I9604cd4046a5ab1486373d0572ddf504d4691196
2016-04-19 14:38:44 -06:00
Itxaka 0039ac0400 Add download button for volume transfer creds
Adds a download credentials button for the volume
transfer action, available in the transfer details
that appear after creating a new transfer

Change-Id: Iaec6eb5487416f68afacbff272b22e86b41b1582
Closes-Bug: 1515648
2016-04-15 11:09:39 +02:00
Rob Cresswell fd92d8ec59 Fix remaining Django 1.9 test failures
This patch gets Horizon to a passing state in the Django 1.9 tests

Co-Authored-By: Itxaka <iserrano@redhat.com>
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Change-Id: Icbc1a3c039de658faa9fba4a2cdd5027345fe94d
Partially-Implements: blueprint drop-dj17
2016-04-09 11:13:16 +00:00
Masco Kaliyamoorthy 49a1a6356d Hide delete volume if it has snapshot
If the volume has a snapshot, it is not allowed to
delete it. In tables the delete action is hidden but
if we go to the volume detail page, the delete action
is available.

This patch hides the delete volume on detail page too.

Change-Id: I4d8690b035dedd7ebcacb3479d346cfb3fb324f1
Closes-Bug: #1546423
2016-02-17 20:21:58 +05:30
Rob Cresswell 83c9e3fead Remove all pre-Django 1.8 workarounds
This patch removes all code workarounds in Horizon for Django versions
before 1.8. As a bonus, this means an extra unit test is run that was
previously skipped.

Change-Id: I63f56953d9beefd3ea596d3e31c6032e936b140c
Partially-Implements: blueprint drop-dj17
2016-01-24 22:12:02 +00:00
Mingyan Bao 091d351553 Add pagination support to the volume page
Cinder v2 supports pagination.
Added to the volumes table for both admin and project.
Also fix the Cinder REST API to handle pagination (like Glance
REST API).

To test: set 'Items Per Page' in the UI Settings page to a low number.

Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>

Change-Id: Ib1772d6e6214dc96a09ce32fb4d9f9fb79d161f0
Closes-Bug: #1316793
2016-01-22 15:18:47 +03:00
Jenkins d1089f8fe8 Merge "Add breadcrumbs on Volume Encryption Details" 2016-01-20 00:32:00 +00:00
LiuNanke f96797a006 Replace assertTrue(isinstance()) with assertIsInstance()
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.

Change-Id: Ib44771be349f359376e35d7673192bc62805b1c2
Closes-Bug: #1268480
2015-12-31 00:05:14 +08:00
kenji-ishii 3ef65bf99a Add breadcrumbs on Volume Encryption Details
At the time there are no method returning to Volume List in Volume
Encryption Details.

Change-Id: I395ba72914579cad73d6d4887ff165d8423e90c8
Closes-Bug: #1523463
2015-12-19 05:40:15 +09:00
Rich Hagarty 70ade476b8 Use "GiB" and "gibibyte" labels in volume panels
Cinder APIs require size values to be in gibibytes (GiB).
Horizon panels show these values in gigabytes (GB), which
confuses storage admins.

Change-Id: I62ab332d3415f35ead237dd1af5f6a11eb193654
Partially-Implements: blueprint gb-to-gib-conversion
Closes-bug: #1511167
2015-12-11 07:28:42 -08:00
Steve McLellan d76a61346e Make unit testing less reliant on HTML fragments
Some tests check for equality with quite large HTML fragments, when
the test is only interested in certain specific things (and not style
changes etc). This patch alters some of those tests (specifically ones
that were tripping up a dependent patch, but can be expanded) to check
the context data of the response, since the actual rendering is tested
by horizon's tests.

It also adds tests to check context data in 'normal' circumstances so
that no test coverage should be lost by this.

Change-Id: I09be82058edc923521ffb4c022515845a18b158d
Closes-Bug: #1517084
2015-11-30 10:24:38 -06:00
Rob Cresswell 7a58d15aec Navigation + cleanup for details pages
Adds a common detail page and a breadcrumb templatetag. The breadcrumb
templatetag defaults to displaying the panel name and the existing page
title, which is usually name_or_id. The templatetag can also access the
context, and accepts a "custom_breadcrumb", for complex nested pages or
customised layouts.

This type of navigation is also useful for small devices (mobile/
tablet), providing logical direction that isn't dependant on the
sidebar being displayed.

Currently implemented in Images, Volumes (simple breadcrumb), Ports and
Subnets (more complex nesting).

This approach has been chosen as manipulation of the URLs was seen as
undesirable, making request.path too unreliable. Furthermore, the
templatetag seperation means this could easily be used in other views.

NOTE: The network details page itself will be updated following the
resolution of https://bugs.launchpad.net/horizon/+bug/1416838

Change-Id: I7443b2ffa61560e5d1fd4d6d91b11201f1db6fac
Partial-Bug: 1413823
2015-11-09 07:01:04 +00:00
eric 16e8229075 Create volume pre-select default vol-type
This change makes it so the create volume screen selects the default
volume type (instead of the "No Volume Type" as the default).

Change-Id: I0fd0993adb422701f00ecfdfc81c737b7d1db794
Closes-bug: #1493433
2015-10-05 15:54:13 -06:00
Matthias Runge 65be1e33a8 Fix cinderclient traces in tests
Change-Id: Ia276ef556aa4633baa0b0a1898c2748d2e53b655
Closes-bug: 1497142
2015-09-18 12:38:26 +02:00
Victor Stinner 4057ff2569 py3: Replace unicode with six.text_type
Initial patch generated by:

    sixer.py unicode horizon openstack_dashboard/ tools/

Partial-Implements: blueprint porting-python3
Change-Id: I8bdec74fbe32a6ff0e65f2f0810a0c698a3b9637
2015-08-27 01:26:02 +02:00
Gloria Gu 84074ce020 Added volume type description for volume type
Added the following features for admin volumes types

1. "Create Volume Type" dialog should include a description field.
2. The volume types table should include description column.
3. The volume types table name and description columns are in-line
editable.
4. The 'Edit Volume Type' action is added for the volume type. User should
   be able to update volume type name and description.

Added the following features in project volumes

1. "Create Volume" dialog will have description for the selected volume
   type when volume type select is available.
2. "No Volume type" will have some description as well.

Implements: blueprint volume-type-description
Change-Id: I7c8548756bcd3566873876bbc59f9b9c21d6846b
2015-08-18 12:46:48 -07:00
Jenkins 73341f6b9a Merge "Use form field errors on volume Extend form" 2015-07-31 15:52:33 +00:00
Zhenguo Niu 5d45cef785 Use form field errors on volume Extend form
Now when extending a volume to a new size which is less then the current
one, we will pop up an error warning message on the top of the form instead
of beside the new size field. now change to use field specified error class
for more accurate.

Closes-Bug: #1480001
Change-Id: I2ee1a562bf548e78d657a3c5bd3307eacf6a3ab1
2015-07-30 23:20:12 +00:00
Victor Stinner 674a45ffe0 Replace mox with mox3
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.

Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
2015-07-13 15:02:10 +02:00
Zhenguo Niu 03308e6863 Exclude current volume_type from Volume retype list
Instead of adding an extra check and throw error messages when
the new volume_type is same with the current one, we should
exclude it from the choices list.

Change-Id: Id91c42ed4a73cc7d5aca34242bf4457a58e8496c
Closes-Bug: #1461856
2015-06-04 22:14:40 +08:00
Gary W. Smith dca7117fdf Permit using latest python-cinderclient
Fix a number of unit tests so that they will work with the latest
cinderclient, which will be released by the end of Kilo.

The problem was that several horizon unit tests made calls into
python-cinderclient that should have been stubbed out (but were not).
These calls silently did nothing in the released python-cinderclient due
to a "feature" where certain GET functions would return an empty list
when the auth url was an empty string, instead of returning an auth
failure.  Recent changes in the python-cinderclient authorization
functions closed this hole, which then revealed problems in the horizon
unit tests:
1) several tests were lacking stubs to cinder calls, and
2) the auth url in test of cinderclient v2 was empty due to a missing
   dictionary entry in test_data/keystone_data.py

Change-Id: I33967a924f4e47009fdc1613248afd1bd377f34f
Closes-Bug: 1423425
Co-Authored-By: Richard Hagarty <richard.hagarty@hp.com>
2015-03-03 15:45:52 -08:00
Jenkins 4ae40a803e Merge "View encryption metadata for encrypted volumes" 2015-02-03 20:22:48 +00:00
Jenkins 5000934297 Merge "Add support for volume transfers" 2015-01-10 22:42:41 +00:00
Jenkins 240068b33c Merge "Add bootable flag to edit volume panel" 2015-01-09 00:06:25 +00:00
Brianna Poulos a8d2a3504c View encryption metadata for encrypted volumes
Although it is possible to see whether a volume is encrypted or not
encrypted (by viewing the "Encrypted" column of the volume), it is
not yet possible to view the encryption metadata for an encrypted
volume.

This patch adds a link to the "Yes" in the Encrypted column of the
volume, which displays an overview of the encryption metadata for
the volume when clicked.  This encryption metadata includes cipher,
key size, provider, control location, and volume type name.  Also
adds unit tests.

Change-Id: Ic57e64eb85b46e77ed03d86722523c316c873d18
Implements: blueprint view-volume-encryption-metadata
2015-01-08 17:32:28 -05:00
Gary W. Smith 18ec30107c Add support for volume transfers
Cinder supports volume transfers, which are transfers of ownership from
one project to another.  The normal flow is that a donor creates a volume
transfer, captures the resulting transfer id and secret authentication
key, and passes that information out of band to the recipient (such as
by email, text message, etc.).  The recipient then accepts the transfer,
supplying the transfer id and authentication key.  The ownership of the
volume is then transferred from the donor to the recipient, and the
volome is no longer visible to the donor.

It is important to know of some limitations about the cinder API for
volume transfers and their impact on the UI design.
1. When creating a volume transfer, you cannot specify who the intended
   recipient will be, and anyone with the transfer ID and auth key can
   claim the volume.  Therefore there is no UI to prompt for a
   recipient.
2. Current volume transfers are only visible to the donor; users in
   other projects are unable to view these transfers.  This makes it
   pointless to create a project table to view and accept volume
   transfers, since the current transfers are not visible.  Instead, the
   transfer information has been added to the volume details, which are
   visible by the donor, and the volume state clearly reflects that a
   transfer has been created.  It it also impossible to present to the
   recipient a pull-down list of transfers to accept.
3. The only time that the authorization key is visible to the donor is
   in the response from the creation of the transfer; after creation it
   is impossible for even the donor to recover it.  Since the donor must
   capture the transfer ID and authorization key in order to send it to
   the recipient, an extra form was created to present this information
   to the donor immediately after the transfer has been created.  It is
   not enough to put the information in a success message, since these
   are typically only displayed for a small number of seconds before
   they disappear.

Co-Authored-By: Gary W. Smith <gary.w.smith@hp.com>
Co-Authored-By: Julie Gravel <julie.gravel@hp.com>

Implements blueprint cinder-volume-transfer

Change-Id: I0134f90c93a8d804d2c87fe9713bcef9e1629d79
2015-01-03 14:30:10 -08:00
Jenkins 3d8479f7a1 Merge "Small performance improvement" 2014-12-17 03:59:18 +00:00
Rich Hagarty 0ecdbacc81 Add bootable flag to edit volume panel
For Project=>Volumes, the edit panel will now allow
the user to set/unset the bootable flag.

Change-Id: Idf913b284f56d52b3bf9be4c716a7c041dd9b5bb
Implements: blueprint volume-bootable-flag
2014-12-15 02:31:02 -08:00
liyingjun 9b58942a84 Small performance improvement
We can use search_opts for volume_list and volume_snapshot_list
instead of filtering the results after we get the whole list to
improve the performance.

Change-Id: Ieb7833038228c97f7415bd57ecd353e218f00cdd
Closes-bug: #1401013
2014-12-12 10:51:52 +08:00
Gloria Gu f0870fb594 No delete volume action for volume with snapshots
Currently a volume with snapshots still has the "Delete Volume" menu
action.

This fix will not allow the "Delete Volume" menu action for a volume
that has snapshots. The main purpose of this change is to be consistent
with the existing behavior when the volume is not in a deletable state.

Closes-Bug: #1394015
Change-Id: If298e04952a29acbe3e8bd89e54065525ae5f30c
2014-12-10 19:05:08 -08:00
Radomir Dopieralski d7ad91e8a8 Replace the glyphicons with font awesome icons
There are still some scss mixins that use the old (from bootstrap 2)
image icons. Replacing them will have to be done in a separate patch.

I also link to the css file, instead of scss, because django-pyscss has
some problems finding the right file. This is reported and will have to
be fixed upstream to unbundle bootstrap.

Change-Id: I67e94a9283bcceef8fc89343f3f5b2d7e0d4449f
Partial-implement: blueprint font-icons-replace
2014-12-01 14:36:38 -07:00
Trung Trinh 9cdfe8712f Field "Volume name" on Horizon no longer mandatory
Change the field of "Volume name" on Horizon dashboard in process
of create or edit volume from mandatory to optional.
This is supported by the fact that Horizon dashboard displays the
volume's ID for the volume's name if its name is None or empty.

Change-Id: Ic8e6f8d3ffe51a4c2faf9ca636215e6e24f435b4
Closes-Bug: #1389172
2014-11-07 22:41:37 +14:00
Gary W. Smith 2794abbf66 Use cinder API v2, remove support for v1
Cinder API v1 was deprecated in Juno and is being removed in Kilo.

Implements: blueprint horizon-cinder-v2-preferred-version
Closes-Bug: 1376424
Change-Id: I9bbdf1753a06d33b441a85ff448f475545eafc80
2014-10-23 16:02:03 +00:00
Jenkins ffc28362fa Merge "Stubout cinder.tenant_absolute_limits in cinder test" 2014-10-18 12:04:40 +00:00
Akihiro Motoki 2a9349bd67 Fix E128 errors in openstack_dashboard/dashboards/project/
E128 continuation line under-indented for visual indent

Partial-Bug: #1375929
Change-Id: I6bc8db7dab6fc2c3aad7fa54b6e07643b595f230
2014-10-16 16:53:52 +09:00
Akihiro Motoki f99981fc9c Fix E127 errors in openstack_dashboard/dashboards/project/
E127 continuation line over-indented for visual indent

Partial-Bug: #1375931
Change-Id: Ia62781d24f13407ca600743b167392dddf6c271d
2014-10-11 13:33:28 +09:00
Akihiro Motoki 1828eecc85 Stubout cinder.tenant_absolute_limits in cinder test
To render dropdown actions to detail page, allowed() method
in the volume table is called, so a method called in allowed()
needs to be stubout.

Change-Id: Ib65eee0fa2c8b6535e1e391579fcd1bdb0f83bc1
Closes-Bug: #1378907
2014-10-11 05:04:03 +09:00
Jenkins ac9c9d557e Merge "Change page header heading to H1" 2014-10-04 00:06:49 +00:00