Commit Graph

207 Commits

Author SHA1 Message Date
Sam Morrison f4bbc99b1a Remove ability to filter instances by VCPUs
This is not supported by the compute API so will never work.

Closes-bug: #1967183
Change-Id: I0c64f9b1c9e48a96118db55c3ec8ab92a72ada8b
2022-03-31 09:19:33 +11:00
Keigo Noha 29da801528 Change to a proper policy for Resume operation
Previously, ToggleSuspend class checked 'os-rescue' policy for resuming
an instance. To align to resume operation, this fix changes to
'os-suspend-server:resume'.

Closes-Bug: #1963652
Change-Id: If6386ecdb81fb1f0d88dab447ee81c251b9857b7
2022-03-04 17:38:20 +09:00
Zuul dd9e4c82b5 Merge "Address RemovedInDjango40Warning (2)" 2022-03-03 10:14:04 +00:00
Vadym Markov d269b1640f Fix for "Resize instance" button
Currently, "Resize instance" widget is not working because it relies on
legacy Nova API v2.46, obsoleted in Pike release. Proposed patch make
Horizon use current Nova API (>=2.47).

Closes-Bug: #1940834
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Id2f38acfc27cdf93cc4341422873e512aaff716a
2022-02-16 16:07:55 +09:00
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
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
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
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 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
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
Gayathri Devi Kathiri 2098eb40d0 Fix "Edit Port Security Groups" tab on Horizon
"Edit Port Security Groups" button is visible to all
roles on Instances.

"policy_rules" is defined in "EditPortSecurityGroups"
class to fix it.

Change-Id: I1030db9143273a7f3bc4d9f097311d2697603cfa
closes-bug: #1878218
2020-05-20 09:36:49 +00:00
Gayathri Devi Kathiri d56a1bfd9d Fix "Rescue Instance" tab on Horizon
"Rescue Instance" button is visible to all
roles on Instances.

"policy_rules" is defined in "RescueInstance"
class to fix it.

Change-Id: Iac7180f9b6099f64c26382d3968fbbc133577d45
closes-bug: #1877574
2020-05-08 13:40:37 +00:00
Corey Bryant 6f4742457f Switch from django string_concat to format_lazy
string_concat was removed in django 2.1 when it reached the end
of it's deprecation cycle. It was removed because the same behavior
can be achieved with format_lazy.

For more details see:
https://docs.djangoproject.com/en/2.2/releases/2.1/

Change-Id: I5e1c9bdfa1d0e049e0516198abbdb76be1667216
Closes-Bug: #1836671
Partial-Bug: #1789046
2019-07-19 16:50:16 -04:00
Zuul 0890d562e4 Merge "Use POST/Redirect/GET for an instance resize form" 2019-07-08 10:32:14 +00:00
Akihiro Motoki fcdc67b819 Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.

Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
2019-07-03 14:54:16 +09:00
BubaVV d6c56c26b3 Use POST/Redirect/GET for an instance resize form
This patch improves UX by blocking a second POST request during page
reload after "Confirm instance resize" action

Closes-Bug: #1826509
Change-Id: I80c66f7828be17ccf06840a06229c447ccb1bb67
2019-05-22 15:51:14 +03:00
Simon Collins 2a3b04ce6c Changed the message level for deleting some resources to info
Added functionality to the handle function in the BatchAction class
in action.py and allowed the easy changing between the alert types
and made deleting images, instances, and volumes give an info alert
rather than a success message and altered the testing parameters

Change-Id: I93251d6d12cf89a331b5c051bf4fe10a6e470f51
Closes-Bug: #1291681
2019-01-03 18:45:08 +13:00
manchandavishal d6217b3e63 Instances column is shortened so it fits properly
The 'Time since created' column name has been shortened to 'Age'
in project instances and admin instances meaning it fits properly
in table header cell and doesn't cause table header height to
increase.

Closes-Bug: #1614287

Change-Id: I94fc9eb260050e187445abd8236ac414b885b467
Co-Authored-By: Sam Wright <swright.wellington@gmail.com>
2018-12-18 10:01:56 +00:00
pengyuesheng ffa8b5404e Support of rescue instance in Horizon
Change-Id: Ie195befde8fe10ce419583ead06fdb759dd3813c
Implements: blueprint instance-rescue-horizon-support
2018-11-20 10:25:37 +00:00
Akihiro Motoki 0c80639805 Improve IP address formatting in Instance table
Previously <h4> and <h5> were used for network names and the title
"Floating IPs". It caused these strings are displayed using larger fonts.
This commit changes they are rendered with same font as for others.

The following changes are also made to save spaces.
* Network name and IP addresses are displayed in a single line.
* IP addresses are sorted in the order of IPv4 first.
* The title "Floating IP" is no longer displayed (I believe an floating
  IPs are still clear as they have global addresses)

Closes-Bug: #1789325
Change-Id: I5bfae9b10609628d16a5919840a56ae135739924
2018-09-10 17:20:57 +00:00
jmoffitt b9a1c445d9 Update attach_volume and detach_volume policy rules
The prior commit for this was functional but not quite
correct. The policy rules currently in Horizon for
attach and detach of volumes don't exist in Nova and
are missing from the local copy of nova_policy.json and
from Nova generated policy files. The fix to use the
create instance copy of the rule only worked for attach
and not detach ( https://review.openstack.org/#/c/570071/ )

This commit updates detach as well, and should be correct
going forward based on the Nova policy rules at:
https://git.openstack.org/cgit/openstack/nova/tree/nova/policies/volumes_attachments.py

Change-Id: I07fccd6f12149cd88a049c46aa113dfd2b60bbaa
Closes-bug: 1772759
2018-05-23 15:19:28 -07:00
jmoffitt 8e3903902d Fix mismatched attach_volume rule
The attach_volume rule on the Compute Instances and Volume pages
does not match the rule in the nova_policy.json file, or what is
generated from an oslo policy generation on Nova. Update the rule
to match what is used in the default policy file, and what Nova
uses in its unit tests.

While looking at this, discovered that the detach_volume has a
similar problem, with no rule that matches at all. It may make sense
to have detach volume use similar permissions to attach

Change-Id: I40c709c7bb0c8538b56624dbfff1faea2eba9ee6
Closes-bug: 1772759
2018-05-22 15:49:54 -07:00
Zuul 3cfc104bd3 Merge "Add "Edit Port Security Groups" action" 2018-05-02 14:52:13 +00:00
Zuul 3e0da5b91c Merge "Fix W503 warnings" 2018-04-24 09:48:08 +00:00
Akihiro Motoki 3adff90a37 Add "Edit Port Security Groups" action
This commit adds a new action "Edit Port Security Groups"
which jumps the interfaces tab of the instance detail page.

In addition, a warning message is added to the "Edit Security Groups"
form because if a user change security groups as an instance level
the change will be applied to all interfaces of the instance, so
it would be nice if we can provide a good navigation to a page
of editting security groups per port.

Previously, UpdateMembersStep does not support help_text_template option.
To use a bold tag in the added help message, we need to use a template
instead of help_text, so _workflow_step_update_members.html is updated.

Closes-Bug: #1750147
Change-Id: I71437a376b94cab90df0e423aa7e1d2d0d8387ee
2018-04-22 07:44:20 +09: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
Akihiro Motoki dd0eba2128 Support simple FIP disassociation (with FIP release)
We previously supported so-called "Simple FIP disassociation"
which allows users to disassociate and release a FIP in a single action.
We no longer support nova-network based features, but I believe it is worth
implemented even in a neutron-only era. This patch introduces a checkbox
"Release floating IP" to support this with neutron.

At the same time, this patch also fixes a bug that the existing FIP
disassociation action disassociates and releases a first FIP of
a requested server. Even though it is a rare case where a single
server has multiple FIPs, this is a bug. After this patch, FIPs
associated with the requested server are listed in the form and
a user can select an FIP to be disassociated.

This patch drops a setting parameter 'simple_ip_management' without
deprecation notice. This is actually no side effect because this setting
just toggled the FIP disassociate action in the instance table and
it provides nothing more than that. We can do the same thing by
the policy file.

Change-Id: Ie8053bdd3a3e4c7897c7c906788d40c2a1d3f708
Closes-Bug: #1226003
2018-04-08 07:29:54 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
Zuul 52115149c2 Merge "Prevent non-admin users from detaching interfaces" 2017-12-13 12:03:31 +00:00
Abdallah Banishamsa c999239fed Prevent non-admin users from detaching interfaces
Remove the option to detach_interface from running instances for
non-admin users.

Change-Id: Id641bde457e8723ace0bc1e49aab2c46b2227485
Closes-bug: #1690790
2017-12-13 03:01:47 -05: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
Ying Zuo 827ed2d596 Revert "Remove the quota check for "Launch Instance" button"
This reverts commit 4083d08e86.

Change-Id: If583c69fce4182d4512e6377cef1558b192572be
2017-10-18 21:02:23 +00:00
Feilong Wang 4083d08e86 Remove the quota check for "Launch Instance" button
This patch is going to remove the quota check for "Launch Instance" button,
because:

1. For some reasons, the quota check/allowed of the launch instance button
will be called 2 times, which takes about 0.14 seconds based on our prod
env (prod API with local horizon)

2. The launch instance form will do the quota check again, so user will
not be able to create instance and don't have to wait resp from nova if
the quota has been exceeded. See https://ibb.co/kor5Tw and
https://ibb.co/kKm8Fb

Partial-Bug: #1662347

Change-Id: I0c4aaf6da29145856f4ab307e40a91c4b47b2135
2017-10-03 23:03:24 +13:00
Jenkins 20eaa03174 Merge "Fix actions inside instance details view page" 2017-09-21 13:29:41 +00:00
zhangdebo1987 dcf5e1ed21 Use WrappingColumn for image name
Replace the image name column class with WrappingColumn to safely wrap
long image names


Change-Id: Id331fb37698e25c0e6c1a4ad93f1c96d969820c6
2017-09-18 09:00:37 +00:00
Dmitry Ratushyy 9e1eb5f5d7 Fix actions inside instance details view page
At the current moment user can not suspend an
instance from the instance "Details" page if the
instance does not belong to the first page of the
instances list. This is fixed.

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Co-Authored-By: Vladislav Kuzmin <vkuzmin@mirantis.com>
Change-Id: I4d805e4a65e838242af38677cbb9efefc498a96f
Closes-Bug: #1553142
2017-09-07 01:08:41 +04:00
Akihiro Motoki 9554177b80 Ensure all filter items end with '='
Previously some filters have '=' and some do not.
This commit ensures all filters have '='.

Only exception is 'Changed Since'. In this case, no '=' is correct
as it means '>='.

Change-Id: I0cb0e39ed80d2caf9509d4d2ec3e3e6957bf56f4
Closes-Bug: #1709882
2017-08-17 09:26:43 +00:00
Jenkins d66c96269d Merge "Attach/detach volume showed in instance actions when cinder disabled" 2017-08-09 02:40:08 +00:00
MinSun 5dc5c04a47 Attach/detach volume showed in instance actions when cinder disabled
If cinder not enabled, we cannot attach/detach volume for an instance.
So it's better not show the drop list.

Change-Id: I09578998c8f1a97bd24fb6043258b94e8f37bc09
Closes-bug: #1703511
2017-08-04 10:13:26 +08:00
Ying Zuo 9a975ebaf5 Show instance resize and rebuild actions in red
Updated the template used for LinkAction to add the css class for
destructive action if action_type is set to "danger".

Removed the action_type for live  migration action because it is
not a destructive action.

Change-Id: Ib957597aa065df4c8a65303b1dc95a5c762ae3d3
Closes-bug: #1704014
2017-07-12 17:47:27 -07: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
Akihiro Motoki b9d0243c33 Fix H405 (multi line docstring) warnings (openstack_dashboard)
H405: multi line docstring summary not separated with an empty line

Closes-Bug: #1696996

Change-Id: Id895695663b19522d9cdc22f8b012e49680d708b
2017-06-09 16:05:31 +00: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
Akihiro Motoki 8b6d3422e8 Drop Nova floating IP dependency from dashboard
This commit drops Nova floating IP dependency from
the dashboard implementation.

* Use neutron policy for floating IP operations.
* SimpleAssociateIP is supported only by Nova API,
  so the action was removed in this patch.

Floating IP support in the nova API wrapper will be dropped
in a separate patch.

Partially implement blueprint drop-nova-network

Change-Id: I1610fb9aa2212b3f34814fdb9894b715a5211d9c
2017-04-28 08:28:41 +00:00
Eddie Ramirez ff42a42c3d Hide IPv6 filter choice if enable_ipv6 is set to False
This patch hides filter choice IPv6 under Project->Instances
and Admin->Instances if OPENSTACK_NEUTRON_NETWORK.enable_ipv6
is set to False

Closes-bug: #1588071
Change-Id: Ibdccb94c2cbc07a8dbbe02f72ca7c8b6a36360f7
2017-04-23 23:23:59 +00:00
Jenkins 24a4905f5e Merge "Update Horizon to use latest nova policy rules for validation" 2017-04-05 20:34:46 +00:00
Rob Cresswell 24e52a8765 Add Microversion support to Horizon
This patch adds microversion support to Horizon, as well as
documentation, service references, tests and an example.

Implements: blueprint microversion-support
Change-Id: Ic5aa559dbc13aa84d8e4a14b68f26f5d84183fa9
2017-03-27 17:24:23 +02:00