Commit Graph

173 Commits

Author SHA1 Message Date
manchandavishal 6ac31e0ba8 Drop Django based implementation of launch instance
horizon already deprecated launch instance Django based implementation
in the wallaby cycle [1]. This patch remove code for launch instance
Django based implementation as angular based implementation is the
default one from long and all features gaps between angular and Django
implementation is closed.

It also moves SetAdvanced step code to ``resize_instance.py`` as
``workflows/create_instance.py`` file is deleted and remove server_group
option from Advanced Options of resizing instance action because
"server_group" is not required while resizing an instance as per
nova-api reference [2].

Closes-Bug: #1869222

[1] https://review.opendev.org/c/openstack/horizon/+/779125
[2] https://docs.openstack.org/api-ref/compute/?expanded=resize-server-resize-action-detail#resize-server-resize-action

Change-Id: I5e01cd81f309491f1a58ea93911030366a86e3c7
2022-01-24 16:21:18 +05:30
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
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
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
Akihiro Motoki 6a07f5a5b4 Avoid stripping leading/traling spaces in password forms
There are cases where leading/trailing spaces are included in passwords
We should not touch passwords input in forms and pass them to auth
backends without any modifications. The detail was discussed in
the mailing list thread [1] referred in the bug comment.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-January/thread.html#12223

Change-Id: I98de224cc77a98fa216ec3bc032412325e661e14
Closes-Bug: #1861224
2020-02-05 14:41:49 +09:00
Ivan Kolodyazhny d870b40583 Remove six usage from openstack_dashboard package
We don't support Python 2 anymore so we don't need this
compatibility library.

six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.

This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.

Change-Id: I26a59176be9e9f213128e4945a58b9459334b626
2020-01-15 12:47:48 +02:00
Akihiro Motoki e9f75a7bcb pylint: fix useless-super-delegation warning
Change-Id: Iddea27e720dc7184fa3d524a2a465732f18d4dee
2019-01-16 13:05:09 +09:00
wangliangyu 5f4057f8b5 Show snapshots list correctly when launching instance
In launch instance modal, when a user selects 'Instance Snapshots',
not all snapshots are listed. The snapshots which are created from
an instance with new volume or an instance created from volume
or volume snapshot don't have 'image_type' but 'block_device_mapping'.
So, judging only by image_type is not enough.

Change-Id: I7e175b6a7260ca3d82560427a8f742f8cfa35565
Closes-Bug: #1627619
2018-11-06 22:06:52 +00:00
Zuul 63ac162658 Merge "quota: Merge tenant_limit_usages into tenant_quota_usages" 2018-05-16 16:52:55 +00:00
Akihiro Motoki d16ed45e06 Support "Get me a network" in launch instance
"Get-me-a-network" feature is supported in Nova API 2.37 or later.
To support this in horizon, a dummy "auto_allocated_network" is shown
in the launch instance form. I believe this approach fits the current
way of the launch instance form. The dummy network is a special network ID
and if specified the nova API wrapper converts 'nics' parameter properly.

In addition, a dummy "auto_allocated_network" is now shown in the network
table. This is because Neutron creates an actual auto allocated network
once a server is created specifying nics=="auto".
I believe this fake behavior brings consistency in the network table
to some extent, while this is just a compromise.

Note that this patch does not cover the network topology integration.
"auto_allocated_network" is not shown until the actual auto allocated
network is created. The network topology integration requires more work.
For example, the link for the fake auto allocated network should be
disabled in the flat view. The pop-up for the fake auto allocated network
should be disabled in the graph view.

Change-Id: I062fc1b7ed75dc771ddc7f13c8324ed4ffab6808
Closes-Bug: #1690433
2018-05-07 20:49:29 +09:00
Akihiro Motoki df780f21d7 quota: Merge tenant_limit_usages into tenant_quota_usages
The response of tenant_quota_usages is now baesd on the limit API,
so tenant_limit_usages and tenant_quota_usages provide same information.
This commit changes all consumers of tenant_limit_usages to use
tenant_quota_usages and updates the corresponding templates.

blueprint make-quotas-great-again
Change-Id: I620e2946f2aca31bac134c247ceaf971498f9eeb
2018-05-02 01:19:25 +09:00
Zuul 3e0da5b91c Merge "Fix W503 warnings" 2018-04-24 09:48:08 +00:00
Akihiro Motoki 11eb4e9d3e Fix W503 warnings
W503 line break before binary operator

Looking at the code base, it sounds okay to follow this check.

Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
2018-04-11 18:13:47 +09:00
wangliangyu fd67e0f664 Only display the bootable volume snapshots when creating instance
The volume snapshot of non-bootable volume could not be as the instance source.
But now,when we select volume snapshot as source, not only bootable volume
snapshots but also non-bootable ones show up.

Change-Id: I36cd02f34029eedb693047a1bf3f01dad05aa1b3
Closes-Bug: #1748724
2018-03-30 10:47:05 +08:00
Akihiro Motoki 4dd60373dc Fix python 3 related test failures
In Python 3.5 with Django 2.0 env, some tests fail.
This commit fixes them.

blueprint django2-support
Change-Id: Ib5ba46d501956ebc7d4f69f17ee86f44319418d2
2018-03-03 07:33:23 +09:00
Ivan Kolodyazhny c13d6da80e Add render method to ThemableCheckboxSelectMultiple
Django 1.11+ doesn't have RenderMixin class for widgets, so we have to
implement render method for ThemableCheckboxSelectMultiple to get it
rendered in a correct way with all supported Django versions until we
find a better solution for our widgets implementation.

Change-Id: I656afb162e130f2b77853368945b74330bedf747
Closes-Bug: #1715066
2017-10-12 04:39:27 +00:00
Mykhailo Dovgal ca0f293cb6 Fix tenant_quota_usages function calls caching
This patch changes type of 'targets' input parameter in
tenant_quota_usages function from list -> tuple. It provides
possibility for @memoized decorator to cache function calls.

Change-Id: I3c32c3b65ae91e8487fda6148f259fe1931d7c9f
Closes-Bug: #1700578
2017-06-26 17:36:07 +03:00
Akihiro Motoki 359467b401 Retrieve quota and usage only for resources really required
tenant_quota_usage() is used to retrieve quota and usage
to determine if a resource can be created.
However, tenant_quota_usage retrieves quota and usage for
all resources and it can be a performance problem.

This commit allows to load quota and usage only for resources
which are actually required.

Closes-Bug: #1675504
Change-Id: Iab7322a337a451a1a040cc2f4b55cc319b1ffc4c
2017-06-14 08:53:32 +00:00
Beth Elwell 5ae41997c4 Add ability to choose flavor in dashboard if value "0"
Adds the ability to choose flavor smaller than that of the glance.min_disk
if the value is "0". The "0" case is a special case which uses the native
base image size as the size of the ephemeral root volume.

Change-Id: I2ed98a2a07fd075b1ea6362d8955911604286d7c
Closes-Bug: #1677206
2017-06-12 12:39:40 +02:00
Akihiro Motoki 9067ae8b0f Move SG and FIP API wrapper to api.neutron
We no longer need to have SG and FIP API wrapper in api.network
as we only supports a single network back-end.

Completes blueprint drop-nova-network

Change-Id: I4e59d897508b497a3cd2ae2fda93b30b786610dc
2017-06-04 17:51:25 +00:00
Akihiro Motoki 07f964c42e Drop Nova security group dependency from dashboard
This commit drops Nova security group dependency from
the dashboard implementation.

security group support in the nova API wrapper will be dropped
in a separate patch.

Also removes api.network.security_group_backend()
as it is no longer needed.

Partially implement blueprint drop-nova-network

Change-Id: I224010eb59068a7cc4f97c2453d499adde7644b4
2017-04-28 08:28:41 +00:00
zhurong a1de2b5447 Update keypair import url
Since this bp reorganise-access-and-security,
move access_and_security to separate panel,
there are some places url need to change too.

Partial-Bug: #1679895

Change-Id: I51ae06363f974ca8e31e9af152ae500de54aa3ed
2017-04-25 09:08:15 +00:00
zhurong b1a9078404 Update the access_and_security url
Since this bp reorganise-access-and-security,
move access_and_security to separate panel,
there are some places url need to change too.

Closes-Bug: #1679895

Change-Id: I59560c479ad77d2452484b2138065a003451f376
2017-04-05 03:33:50 +00:00
Gábor Antal 34a3aa0ba8 Handle log message interpolation by the logger
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages
Change-Id: I51f50935f1eeffe4960562d6309dfdf05814e595
Closes-Bug: #1596829
2017-03-31 20:59:16 +09:00
Jenkins e3cd250a81 Merge "hacking: noqa cleanup in openstack_dashboard" 2017-03-27 05:11:18 +00:00
Rob Cresswell a8f17150bf Remove all remaining vendor specific code
There's some vendor specific code still lingering from several cycles
ago. This patch removes all usage of it, all related tests, and all
default settings.

Implements: blueprint horizon-vendor-split
Change-Id: Ic0bb84f547b07b130480e587bd365f6e7805dfb5
2017-03-22 20:23:12 +00:00
Jenkins ccfa52fad1 Merge "Add charts to show volume quotas on Python launch instance modal" 2017-03-21 17:39:44 +00:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Jenkins 8b759b3d73 Merge "Instance snapshots shown in 'boot from image' list" 2017-03-14 08:42:11 +00:00
Ying Zuo 72af3cf96e Add charts to show volume quotas on Python launch instance modal
Added two charts for Number of Volumes and Total Volume Storage quotas
on Python launch instance modal when cinder is enabled.

The charts reflect the volume usage of the new instances to be created
as the user changes the configuration on the modal.

Change-Id: I68a88cc867dd36f3d29cd77c1825858f86f3713f
Partially-implements: blueprint launch-instance-volume-quotas
2017-02-16 14:55:17 -08:00
Ian Y. Choi 0409080e7b i18n: The same use of args with ugettext_lazy
Different use of args in ungettext_lazy causes
error on import job from translation infrastructure
to horizon repository.

The use of variables in singular and plural strings
needs to be same. This commit also adjusts the string
with ugettext_lazy() as other strings are dealt with.

Change-Id: I9a836178b2d615504950545654242c0a4c196723
Closes-Bug: #1630507
2017-02-02 15:59:57 +00:00
ramyasunkara a2bed9815e Instance snapshots shown in 'boot from image' list
Instance snapshots are now not shown in 'boot from image' list

Change-Id: I19ab25b6c011909da97997f8c0598fe8c426e692
Closes-Bug: #1296627
2016-09-02 16:01:26 +05:30
Jenkins 12d7d0bc72 Merge "Make sure we always get all limits" 2016-06-24 02:42:40 +00:00
Diana Whitten 2b67ae681b Horizon selects are now themable: Launch Instance
Horizon was using a standard select input.  Unfortunately, this type
of input is only customizable to a small extent.

Co-Authored-By: Ryan Peters <rjpeter2@gmail.com>
Co-Authored-By: Matthew Wood <woodm1979@gmail.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>

Change-Id: Iaf8427c3fff6d2fbfae944731fd9f6f754ed7c31
Partially-implements: blueprint horizon-theme-css-reorg
2016-06-08 18:25:23 +00:00
Itxaka 35eb25a955 Make sure we always get all limits
When checking with nova for the absolute limits
we were not taking into account the reserved
quotas (i.e. instance in rebuilding will take
cpu and ram) so this could lead to wrongly
thinking that the user could launch more instances
that its quota allowed. It also made the overview
page display wrong quotas as it didnt took into
account those reserved resources.

Change-Id: If51470d185ddc122acbdf4cf0d0fd952f3f791a0
Closes-bug: 1561310
2016-06-08 10:40:46 +00:00
David Wahlstrom 1c0d8ce093 Simplify "Instance Count" verbiage
When launching an instance, having the field "Instance Count" with the
help message of "Number of instances to launch" does not seem very
useful from a users perspective.  Simply naming the field "Number of
Instances" clarifies the purpose of this field and removes the need for
any help message.

Change-Id: If0b0e088bf4d1ba44fd4890c77275eaf182964eb
2016-05-09 15:14:40 -07:00
Brad Pokorny bc2826efd9 Choose a server group when booting a VM
Allow users to choose a server group when booting a VM.  Adds
a dropdown list to select a server group to the Launch Instance
workflow.

Change-Id: I0b0d5ec79841da3da569bd22c533fdbf76002c96
Partially-Implements: blueprint nova-server-groups
2016-05-03 15:56:23 -07:00
LIU Yulong d3dd5e0ff0 Make no response notification(msg) level to INFO
Some API calls just sent but the results were uncertain,
Horizon should notify the user that your request is
just accepted, not successfully.
So this patch change some form message level to INFO,
and some message expression.

Change-Id: I241cd9cf3ad6b2bd747e3ea1c6040a140ba77b56
Closes-Bug: #1326301
Closes-Bug: #1286418
2016-03-29 21:12:31 +08:00
Diana Whitten 259973dd06 Horizon Checkboxes are now themeable.
Horizon checkboxes were using a standard checkbox. Unfortunately,
this type of checkbox is only customizable through Chrome, and
even then, its not completely flexible.

The default checkboxes have now been altered to allow for a highly
customized experience through the use of CSS pseudo elements and
Icon Fonts. This allows the color, size and unselected and selected
states of the checkbox to be customized.

The 'default' theme uses the standard Font Awesome checked and
unchecked icons.  The 'material' now uses the Material Design
checkbox design.

It was also noticed (and fixed) that the help-icon on the forms
were not the same color as its corresponding text.

Partially-Implements: blueprint horizon-theme-css-reorg

Change-Id: I52602357d831a5e978fe6916b37b0cde9edb2b9b
2016-03-02 19:17:09 -07:00
IWAMOTO Toshihiro 2e59431227 Look for volumev2 endpoints instead of volume
Volumes tabs should be enabled when volumev2 endpoint is registered.
Currently, Horizon considers no volume service is running if there
is no V1 endpoint, which doesn't make sense as Horizon no longer
supports the cinder V1 protocol.

Co-Authored-By: itxaka <itxaka@redhat.com>
Change-Id: I35d821eedb75f73f9330ed11f921694104eed0c6
Closes-Bug: 1415712
2016-02-23 11:47:25 +01:00
Itxaka c0aab9adf3 Add Network Port selection to instance launch
Adds a new step to the launch instance wizard
to select any available ports to attach on launch.
Modifies the existing tests to take the new step
and calls insto consideration.

DocImpact: Add port info to user-guide/dashboard_launch_instances.html
Change-Id: I97b24be0d75b69638aeb52bda7d0d0541a80663a
Implements: blueprint allow-launching-ports
2016-02-05 15:44:25 +00:00
Jenkins 4a412bda01 Merge "Trust sql middleware value conversion and stick to the spec type." 2016-01-22 16:29:05 +00:00
LiuNanke 362976dde6 Use new log style when LOG.error
Use new log style replace the old Logger.exception()
in according to the link:
http://docs.openstack.org/developer/oslo.log/usage.html
Closes-Bug: #1529534

Change-Id: I5aa58bd6fa666c84dc200ecb44ba595f970f0613
2015-12-30 15:20:22 +00:00
Akihiro Motoki 5fc26b0a11 Replace "Terminate Instance" with "Delete Instance"
"Delete" is being used almost everywhere in OpenStack Dashboard
except the instance panel. Using "Delete" looks more consistent.
In addition, "Delete" tells non-native English speakers that
deleted instances will be no longer usable again compared to
"Terminate".

DocImpact
Closes-Bug: #1502773
Change-Id: Idccaf3c45566f20f11d02ada64c1d3934a6f3002
2015-11-30 03:55:19 +09:00
Victor Stinner 4b53a56822 Fix TypeError on comparison on Python 3
On Python 3, comparison between None and int or comparison between
dictionaries raises a TypeError.

LaunchForm: use 0 default value instead of None to compare it to 1.

sort() and sorted(): use a key function to compare strings instead of
comparing dictionaries.

Partial-Implements: blueprint porting-python3
Change-Id: I0664c2f6c19c3f105da8b4b5a72cea4eb02c245d
2015-10-06 16:40:35 +02:00
lyanchih a1db17aeff Couldn't provision instance from volume snapshot
When user create instance from volume snapshot. Horizon will send
request to nova and it contain some information about block device
mapping. But the source type was assigned 'volume'. Therefore nova will
recognized this instance was boot from volume instead of snapshot, then
nova couldn't find the id of volume.

The source type of block device mapping should be determined by whether
this instance was boot from volume or snapshot.

Closes-Bug: 1474283

Change-Id: I38765513833a03f632be11e168efad28aedcf7f0
2015-09-18 01:42:02 +00:00
David Lyle 1191183a9d Launch instance create volume fails
From both launch instances, if selecting create volume the value passed
for delete_on_termination is converted to an int. This causes launch
instance to fail with an error like:

Error: Invalid input for field/attribute delete_on_termination. Value:
0. 0 is not of type 'boolean', 'string' (HTTP 400) (Request-ID:
req-aee15975-0351-4477-9007-f8fd090bcc49)

This is returned from the nova API. The only reference I can find for
the value type is:
https://github.com/openstack/nova/blob/master/nova/objects/block_device.py#L75

This change leaves the value as a boolean in both workflows and converts
the tests appropriately.

Closes-Bug: #1494067
Change-Id: I54591269eafe5b89b49a13c29c53611c100d600e
2015-09-09 19:20:02 -06:00
Jenkins 192a830b24 Merge "Add config setting to require keypair on instance create" 2015-09-04 04:51:10 +00:00
ericpeterson-l cdb7eba0e8 Add config setting to require keypair on instance create
Fixes: bug #1283148

Change-Id: Ia20afae2b3553f8f43080bc03863d87486a386ab
2015-09-01 18:21:47 +00:00