Commit Graph

32 Commits

Author SHA1 Message Date
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
David Lyle 78de547871 Fix policy function check error
Change in I8a346e55bb98e4e22e0c14a614c45d493d20feb4 to make
POLICY_CHECK_FUNCTION a string rather than a function was incomplete.

The case in horizon/tables/base.py is problematic in particular and results in
raising the TypeError: 'str' object is not callable error.

There is another instance that is not problematic, but is changed for
consistency sake.

Change-Id: Ifc616e322eb38ec7e5ac218f7f3c5ccec52e40f4
Closes-Bug: #1818292
2019-03-01 14:21:07 -07:00
Akihiro Motoki cebe212d00 Bump hacking to 1.1.0
Fix the following new errors:
* E305 expected 2 blank lines after class or function definition, found 1
* E126 continuation line over-indented for hanging indent

max_line_length is set to 80 as the default value in pycodestyle is 79
but horizon uses 80 as max_line_length.

Ignore W504 and F405 by configurations.
Reasons of disabling them are explained as comments in tox.ini.

Change-Id: Iee8bcd60c30883fc8c74f08cf20af853cbb5e271
2018-11-10 16:44:25 +09:00
Akihiro Motoki eac3e7032a Drop Heat related code from horizon
Orchestration tab in the admin info panel needs a discussion.
It seems not to be covered by heat-dashboard yet.

blueprint heat-dashboard-split-out

Change-Id: I56e6edb1f2ac72e2f42d0e9f3291308e67f24cad
2017-12-05 07:38:55 +00:00
Akihiro Motoki af3b7e4134 flake8-import-order: Ensure to place project imports last
To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checks only standard imports or not.

Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe
2017-09-20 01:19:38 +00:00
David Lyle b8cacab927 Remove broken telemetry policy check
The reference to telemetry policy is no longer needed as well
as broken causing the admin dashboard to show up inappropriately.

Closes-Bug: #1643009
Change-Id: I07406f5d6c23b0fcc34df00a29b573ffc2c900e7
2016-11-18 10:16:11 -07:00
Yves-Gwenael Bourhis 797f823c6e Never import setting from openstack_dashboard
Unittests have their own settings and should not source openstack_dashboard
settings.
It is commonly known that django code should always import settings via
"from django.conf import settings".

Change-Id: I4fb5f68ed9595c5f785437b863e2eef7f6ab23c1
Closes-Bug: #1596466
2016-06-27 11:39:01 +02:00
Kenji Ishii cb0d1eaf46 admin permissions depends on OPENSTACK_KEYSTONE_ADMIN_ROLES
In dashboard or panel, 'openstack.roles.xxx' is used
as a permission control. 'xxx' in 'openstack.roles.xxx'
is a real role name.
At the moment, it is not addressed OPENSTACK_KEYSTONE_ADMIN_ROLES.
This patch will address it.

Change-Id: Ic7200dfdf403b63ef3210750617ae102b15c02c8
Closes-Bug: #1534409
2016-06-10 07:23:09 +00:00
Paul Karikh ce5fb26bf5 Remove admin role name 'admin' hardcode
Because of hardcoding name as the 'admin' was impossible to
use administrative panel with a custom administrative role name.
This fix replaces hardcoding the name of the administrative role
with RBAC policy check.

DocImpact
Related commit: https://review.openstack.org/#/c/123745/
Change-Id: I05c8fc750c56f6f6bb49a435662e821eb0d6ba30
Closes-Bug: #1161144
2016-05-31 10:38:22 +00:00
daniel-a-nguyen 2b846515f3 Retrieve domain scoped token
This patch supports using domain scoped tokens against keystone v3.

Use Cases:

Cloud Admin - view and manage identity resources across domains
Domain Admin - view and manage identity resources in the domain logged in
User - view identity project in the domain logged in

Regression:

Supports keystone v2 through local_settings.py configuration
Supports keystone v3 with multidomain = False
Supports keystone v3 with mulitdomain = True

Relates to https://review.openstack.org/#/c/141153/

Background on how to test is here
https://wiki.openstack.org/wiki/Horizon/DomainWorkFlow

Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: woomatt <matt.wood@hp.com>

Partially Implements: blueprint domain-scoped-tokens

Closes-Bug: #1413851
Change-Id: Iaa19bfef9b0c70304ff81d083c62b218b2d02479
2016-03-08 15:17:38 -08:00
David Lyle 8303782f1e Move Horizon to pure plugin loading only
The root cause of 1479018 was the mixed method for loading content in
horizon. This patch moves horizon to load purely from enabled files.
There are a couple of things that were required to allow this change.

1) Adding a mechanism, can_register() to horizon/base.py to handle the
configuration based loading checks that had been accumulating in the
panel.py files. This is an optional static method in Panel to
encapsulate such configuration (read settings) based panel loading
logic. And added testing for and documentation for this addition.

2) Create a numbering scheme for plugins. Moved the base dashboards to
_1000_project.py _2000_admin.py _3000_identity.py _5000_settings.py.
then populated the required panel_group and panel enabled files sparsely
in those ranges. The sparseness is to allow for future additions.
Additionally, I moved the already added Angular based panels next to
their Django counterparts.

Once the configuration loading was normalized, the bug reported in
1479018 was resolved and tests work with plugins panels in all
dashboards.

Close-Bug: #1479018
Partially implements: blueprint plugin-sanity

Change-Id: I657e7ce37b2593a901a859cebf3d6ff8ada91941
2015-08-03 14:49:31 -06:00
Travis Tripp 7e5f4d1594 Base Glance Metadata Definitions Admin UI
Provide a base admin UI for viewing, importing, and associating the
metadata definitions that can be used with various resource types
such as flavors, images, and host aggregates.

In Juno, Glance provided a metadata definitions catalog[1][2] where
users can register the available metadata definitions that can be used
on different types of resources (images, artifacts, volumes, flavors,
aggregates, etc). This includes key / value pairs such as
properties, extra specs, etc. Horizon landed several patches that
read these properties. You can view the functionality in the
"update metadata" action on Flavors, Images, and Host Aggregates.

This specific patch is to bring in the Admin UI for the basic coarse
grained actions on the definitions in the catalog. This includes creating
(importing) a namespace, viewing the overview details about
it, deleting the namespace, and associating the namespace for use with
specific resource types.

Future blueprints will be registered for:
 - CRUD on individual metadata definitions within the namespace
For example, editing the default value of an individual property.

[1] Approved Glance Juno Spec:
https://github.com/openstack/glance-specs/blob/master/specs/juno/metadata-schema-catalog.rst

[2] Glance PTL Juno Feature Overview:
https://www.youtube.com/watch?v=3ptriiw1wK8&t=14m27s

Co-Authored-By: Travis Tripp <travis.tripp@hp.com>
Co-Authored-By: Santiago Baldassin<santiago.b.baldassin@intel.com>
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
DocImpact: Concept awareness
Change-Id: Ie34007f73af7e0941631a52f03841068e509a72c
Implements: blueprint glance-metadata-definitions-base-admin-ui
2014-12-17 16:10:53 -07:00
Sergio Cazzolato b2dd9ded59 Revert "Remove the update default quotas feature"
This reverts commit ed586a0355.

The quota_class subcommand in python-novaclient was used to set default
quota values so it shouldn't have been removed. As now it is being
restored, the defaults quota panel is being restored too.

Related mailing list thread on the topic:
http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Resolved merge conflicts by hand in:
openstack_dashboard/api/cinder.py
openstack_dashboard/dashboards/admin/info/tabs.py
openstack_dashboard/dashboards/admin/info/tests.py

Updated translatable segments to match refactors in
openstack_dashboard/dashboards/admin/defaults/workflows.py
openstack_dashboard/dashboards/admin/defaults/tables.py

Fixed most egregious post-merge styling errors in
openstack_dashboard/dashboards/admin/defaults/templates/defaults/index.html
(probably should have been separate, but I just couldn't let it out that way!)

Removed unrelated file that was allowed to be part of the original commit
doc/source/topics/settings.rst

Co-Authored-By: Doug Fish <drfish@us.ibm.com>
Change-Id: Ic4c4ecec843c7ea9afd0db36ce0eb15952da15b3
Partial-Bug: #1299517
2014-09-30 18:12:02 +09:00
David Lyle 18e8ea810d Separating Identity Dashboard and using RBAC
Moving identity panels to their own dashboard.

RBAC is now used to determine the data to load in the identity
dashboard. Using the default policy file, a user with role member
will now be able to see their project list.

Also, adding a policy check mechanism at the panel and dashboard
level to determine which panels and dashboards the user can access.

Implements blueprint separate-identity-dash

Change-Id: I7ebfec2bf6e44899bec79d3b23c90d56a976200f
2014-08-18 16:40:56 -06:00
Doug Fish 0c1779bfad Remove "Panel" from navigation elements
"Panel" isn't really needed or helpful in the Navigation.  It should
be removed for consistency with the other dashboard.

Change-Id: I0b7fe66a500cae7bd922bcc81a4c930ba03e3028
Closes-Bug:  #1324661
2014-05-29 14:31:52 -05:00
He Yongli e790ac070e Remove extraneous vim configuration comments
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
2014-05-06 15:30:10 +08:00
Sergio Cazzolato ed586a0355 Remove the update default quotas feature
The default quota panel has been moved to a tab in the system
info panel.
The update default quotas feature has been removed.
The cinder quota-class methods have been removed to keep consistency.
The test cases and the apis for nova and cinder have been modified
according the change.

This change is done to support the change:
I1110022d6f628d03aaf363da707f2d2ef1600437

Change-Id: I193c7209d9681b6d69afe0d996153ac86850d243
Closes-Bug: #1292589
2014-03-26 12:19:21 -03:00
Facundo Farias ed1525bc91 Host aggregates panel.
On this panel, aggregates could be added, deleted and edited.
This patch takes the aggregates panel out of System Info and
puts it back in the main admin panel list, as now, aggregates
are not static information. The host can be associated to a
host aggregate on this panel as well.

Change-Id: I4ef2d87c33981db36d4ebd3de2f4841cdfa9dbfd
Closes-Bug: #1261932
Implements: blueprint manage-host-aggregates
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Alejandro Paredes <alejandro.e.paredes@intel.com>
2014-03-04 15:25:32 +00:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
Ladislav Smola bef4ee0489 Add metering panel to admin console
Now it has usage tables for disk usage,
network traffic usage, network(neutron) usage,
objectstore usage, all agregates of project.

A multiseries linechart with choosable meters, group by, value and time
span.

Reasonable amount of tests implemented over all resource usage tabs.

Change-Id: I21342d595ee08da45707e909f3d9802707d912cc
Implements: blueprint admin-resource-usage-page
2013-09-03 10:20:23 +10:00
liyingjun 5f8e370f2d Allow admins to update default quotas
Add update default quotas form to edit the default quotas.

Move the editable default quotas tab to a new panel called
"Defaults".

Implements blueprint edit-default-quota

Change-Id: I6e3806226cd2f699f16b93c25e294bc67883738f
2013-08-29 23:18:08 +08:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Gabriel Hurley c4ac732aa9 Adds availability zone info to System Info panel
Also moves the host aggregates data into System Info panel
because it's exactly the type of static information that
belongs there, and it reduces a significant amount of
boilerplate.

Incidentally adds a new table feature to make listing
out unordered lists of items easier.

Implements blueprint show-zone-for-admin

Change-Id: Id8fb5c9615b018135a5d90eaa82eb80ff63bb7dc
2013-08-19 23:13:10 -07:00
Christian Berendt 07b134334f adding aggregates panel to admin dashboard
This commit adds a new panel "Aggregates" to the admin panel in
the dashboard listing defined aggregates.

fixes bug #1197775

Change-Id: I19c00cf393844199acc1b0eb93e10c35099627a6
2013-07-25 07:56:38 +02:00
David Lyle 87084f7af8 Adding the ability to set/use domain context
Setting the domain context allows admins to view the identity
resources (projects, users, groups) for a particular domain.
The context can be set or cleared.  The default is no domain
context set.  If no context set, the current behavior of listing
all resources across domains is maintained.

Additionally, the identity panels have been grouped in a new
PanelGroup called Identity Panel to logically separate this
functionality from other service related panels.

Implements: blueprint domain-context

Change-Id: I5dd6279129824971968c20fd30919b109bf6b00a
2013-07-10 09:00:09 -06:00
Christian Berendt f678336cd7 adding hypervisors panel to admin dashboard
This commit adds a new panel "Hypervisors" to the system panel in
the admin dashboard listing all registered hypervisors hosts by
using the os-hypervisors extension of the Nova API.

fixes bug #1197763

Change-Id: I3f9a7858342c3592521b7fa8ecf17e2fb5af6cda
2013-07-05 07:13:16 +02:00
Lin Hua Cheng fa32d84b0e Group CRUD and Management in Admin Dashboard.
Add support for CRUD on Group for admin users. It also includes
the user management capability for the group.

Keystone revokes the token when a user is added or removed from the
group. If the logon user is added/removed from the group, the user
will be redirected to the login page.

This feature is only exposed if the user explicitly set horizon
for keystone V3.

Implements blueprint admin-group-crud

Change-Id: I1b5456af80bcc35e9d16ac6ba6792e82704e76fd
2013-05-27 21:45:41 -07:00
David Lyle d774f23ea2 Adding CRUD for roles
This adds basic support for CRUD on roles for admin users.

The CRUD operations in keystone are only exposed without an
extension in V3.  So if the python-keystoneclient does not support
V3, the panel will not be registered.

Support for blocking create, edit and delete in LDAP case added.

Implements: blueprint admin-role-crud

Change-Id: Ibd727df1392ab9a748ab585620c1ff3dc57d3efb
2013-05-24 09:07:54 -06:00
Lin Hua Cheng c119343f6a Adding Domain CRUD in Admin Dashboard.
Add basic support for CRUD on Domain for admin users.

This feature is only exposed if the user explicitly set
the OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT to True and
keystone supports V3.

Creating projects, users and groups on a specific domain
will be covered separately on domain-context blueprint.

Implements blueprint admin-domain-crud

Change-Id: If2684331776166dd9579716deebca100770a5ce0
2013-05-22 11:39:32 -07:00
Nachi Ueno eed092a5bb Support Quantum L3 function
Implements bp quantum-l3-support
Implemented basic CRD for router
Add/remove interface support
Support set gateway and clear gateway

Change-Id: Ie4cac962eb8fadc021c80cf05e2aa63caab3c00a
2013-01-07 20:24:57 -08:00
Gabriel Hurley 2f98befe3f Reworks quotas and services panels into System Info panel.
This is a step towards combining all the "read only" data about
an OpenStack cloud into one place for admin inspection.

Implements blueprint system-info-panel.

Change-Id: I2dc52a855c1c8a488fb9c66b82e0faca765b3812
2012-11-17 15:49:17 -08:00
Gabriel Hurley cb8e7c1f8f Splits OpenStack Dashboard bits from framework app code.
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.

Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b
2012-10-11 11:47:50 -07:00