Commit Graph

30 Commits

Author SHA1 Message Date
Zuul 0798bdacd3 Merge "Add SYSTEM_SCOPE_SERVICES setting that hides panels" 2022-03-24 10:36:17 +00:00
Radomir Dopieralski 6c814b241d Add SYSTEM_SCOPE_SERVICES setting that hides panels
Since not all services are ready to use the system scope token,
we need a way to disable and enable the use of system scope
token on a per-service basis. This setting let us configure
which services should use the system scope token. By default
the list is empty and system scope token is not used at all.

Change-Id: I5e0cdc7288221571f183a37b800c19dc4cff5707
2022-03-10 15:13:21 +01:00
Akihiro Motoki d9266fd82c Address RemovedInDjango40Warning (3)
In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path().

https://docs.djangoproject.com/en/4.0/releases/3.1/#id2

Change-Id: I484694f8718f61c022126a1935cf28fce075894b
2022-02-04 16:26:54 +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
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 ec970fd6e8 Handle partial dict setting
In Train cycle, we moved the definition of default values
to openstack_dashboard/defaults.py. The current code accesses
a dict member using []. It requires operators to define a dict
setting with a full member.

This commit allows to use dict-type settings with partial members.

A new function is introduced to retrieve a dict-type setting
considering default values defined in
{openstack_dashboard,horizon,openstack_auth}/defaults.py

Change-Id: I7ff0ad4bca698aef9c0eba370b0570200a14367a
Closes-Bug: #1843104
2019-09-26 14:31:17 +09:00
Akihiro Motoki 53486be43f Define default settings explicitly (openstack_dashboard 2/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/admin/.

Part of blueprint ini-based-configuration
Change-Id: Ifb3e9401a926ba9e035e1b498a4a4493c1b594f5
2019-04-24 02:32:47 +09:00
Akihiro Motoki 59beb951a3 pylint: Fix consider-using-(dict|set)-comprehension
Change-Id: I81c694c17106c179a53326a12e78cfa899872970
2019-01-13 00:59:05 +09:00
pengyuesheng 797859beb7 Floating ip filter has no effect
the API of tenant_floating_ip_list add '**search_opts',

Change-Id: Ie4f47f768909a2af7a916d2ad6ce43b3e157b432
Closes-Bug: #1763280
2018-08-23 09:58:16 +08:00
zhubx007 446abc41bf add dns_name and dns_domain into admin column
https://review.openstack.org/#/c/561185/
According to the above merged commit, dns_name and
dns_domain are added into project/floating_ips/tables.py.

But because of the class 'FloatingIPsTable' inherits
the project_tables.FloatingIPsTable, so that we should
add dns_name and dns_domain into columns of Meta.

If not, if you click the Admin/Network/Floating IPs, the
page will crash.

Closes-Bug: #1785897
Change-Id: I6e933749a56a492989cab002c1b65656b7e2c65b
2018-08-07 21:02:51 +00:00
Jens Harbott 9e703aec2f Add DNS parameters to Floating IP panels
This adds support for the "DNS Domain" and "DNS Name" options to the
panels for listing and allocation Floating IPs.

These options are available as a Neutron extension, so we need to
make them conditional based on the availability of that extension.

Change-Id: Ife8e19aac44dccbdf11a6a6d4bb50cd3b7ed8d8e
2018-07-22 20:24:36 +09:00
Vladislav Kuzmin 4c084ada26 Convert admin.floating_ips tests into mock
Change-Id: Id71f10643343f8fee7cfc05bbeaabe56f10075d4
2018-03-06 14:04:07 +04: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
Trygve Vea d1225c606e Floating IP: Expose description field in form and tables
The networking API supports setting a description on floating IP addresses.
This patch adds a form input field to the allocation form, and a column to the
table that displays floating IP list.

Closes-Bug: #1738625
Change-Id: I3cec286d01f319402dd652f2f0fe7a59e7d1cfbb
2017-12-17 12:58:50 +00:00
Cao Xuan Hoang f7eec152c2 Use ThemableChoiceField
There are still remain some ChoiceField that have not covered.

Closes-Bug: #1732317
Change-Id: Ib9be4f252eba08374f87e4fef5e702a6ea8c1226
2017-11-15 02:27:56 +00:00
Eddie Ramirez d6f1d117b4 Add server-side filtering Floating IPs
References for field selection:
https://developer.openstack.org/api-ref/networking/v2/index.html?expanded=list-floating-ips-detail
https://github.com/openstack/python-neutronclient/blob/master/neutronclient/neutron/v2_0/floatingip.py

Co-authored-by: Eddie Ramirez <eddie.ramirez@intel.com>
Co-authored-by: David Lyle <dklyle0@gmail.com>

Implements blueprint: server-side-filtering

Change-Id: I614f0b1d9cf685aed3e3663d512a4ccd92455093
2017-09-14 23:30:57 +00: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
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
wei.ying ba3ef0efb3 Use subnet id to allocate floating IP in Admin panel
In the admin allocate floating IP form, the pool select display
the subnet cidr info, which should be used subnet id when creating a
floating IP. This patch fix it.

Change-Id: I4f12027c90e580824d74b10010bf799515920702
Closes-Bug: #1689230
2017-05-18 09:51:28 +08:00
Akihiro Motoki acd3f2a240 Drop novalclient security group and floating IP dependency
novaclient 8.0.0 dropped python bindings for security group and
floating IP. This commit drops security group and floating IP logics
from the nova API wrapper.

The following changes are made accordingly.

* Update unit tests to consume neutron test data
* Drop API unit tests for nova security group and floating IP

Partially implement blueprint drop-nova-network
Change-Id: I946c508d7a82162fc8434213e006513867b79350
2017-04-28 08:38:28 +00:00
wei.ying fa3528933c Delete instance,volume,etc confirmation is missing name or ID
If click the name link and go into the details page for the instance, volume, etc.
And attempt to delete. It will pop up a message, but omit the name/id.
Need to add the property of 'data-display' in detail page.

Change-Id: I9c1966dc7942a27903237e2786edbcd2fbd936ea
Closes-Bug: #1680329
2017-04-07 22:58: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
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
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
Rob Cresswell 99849ad88f Move Floating IPs from Access & Security to panel
This patch makes the Floating IPs tab in Access & Security its own panel
under Project > Network

Change-Id: Ibb83ae5a0448d2824c10f867e620cec8219b7b72
Implements: blueprint reorganise-access-and-security
2017-02-01 18:57:44 +00:00
Rob Cresswell 560f23a1c9 Add default common template to python table views
Many of the Python table views are using identical (or nearly identical)
table templates. This patch adds a common template and makes it the
default for a DataTableView, which allows us to remove many similar
templates and redundant lines of code.

Change-Id: I1e4e15e695ee1f21f4d44f141a854e30f1e567a1
Closes-Bug: 1653986
2017-01-05 08:59:35 +00:00
Rob Cresswell 83e3ff88ec Remove duplicated modal_header statements
Across the codebase we've been using modal_header values that are
identical (or very close to) the page_title values. This patch sets the
modal_header to default to the page_title value, and cleans up a few
inconsistencies. Also deleted a couple of redundant submit_label values
that were identical to the default ("Submit").

Change-Id: I88815c3801c29b3fbc41e0cb426a50653255595f
Closes-Bug: 1653960
2017-01-04 13:31:36 +00:00
David Lyle 43e9df85ab Rework hardcoded policy in admin dash
Since the content in a Dashboard is not hardcoded, having hardcoded
policy checks to specific services at the dashboard level is wrong.
The Dashboard was designed to evaluate all panels to determine policy
so this type of thing could be avoided. This patch moves the content
specific policy checks to the panels where they apply.

Additionally, this fix uncovered another bug where policy_rules are
wrapped in a list regardless of format. This patch adds a check and
only wraps where necessary.

Change-Id: I79314a45c3c552ebcb3bb7cc881c2467fa009c5d
Closes-Bug: #1643013
Closes-Bug: #1643074
2016-11-18 15:42:16 -07:00
tamilhce ed3a382dee Fix for typo in Horizon
The horizon views.py had a typo in error msg
Closes-Bug: #1619847

Change-Id: I5d41cb3318ca7a54ec973404cb03afdc3453c021
2016-09-03 15:36:46 +00:00
LIU Yulong 5c238e9117 Add floating IP panel to admin dashboard
Now system administrators have CRUD abilities to manage floating IP.
1.floating IP list table
2.allocate floating IP to specific tenant
3.release/delete floating IP

Partially implements blueprint: manage-ips
Partially implements blueprint: syspanel-floating-ip-list

Change-Id: Ie5ec59740887d3845b933b37e6e875dbf08a4918
2016-08-19 12:15:55 +08:00