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
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
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
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
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
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
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
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
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
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
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
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
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
At the time there are no method returning to Volume List in Volume
Encryption Details.
Change-Id: I395ba72914579cad73d6d4887ff165d8423e90c8
Closes-Bug: #1523463
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
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
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
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
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
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
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
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
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>
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
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
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
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
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
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
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
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
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