Commit Graph

20 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
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 8653f718f2 Define default settings explicitly (openstack_dashboard 4/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/identity/.

Part of blueprint ini-based-configuration
Change-Id: Ibb174f62d0047a10b2832dd2ff350f5f32955b08
2019-07-05 14:49:11 +09:00
Akihiro Motoki c076db20c8 pylint: fix len-as-condition warning
Change-Id: Ib89c1854ad42b96e4caf281160d568fe98430afe
2019-01-16 12:56:20 +09:00
Akihiro Motoki 6e1348d05f pylint: fix several warnings
openstack_dashboard/theme_settings.py:63:8: W1201: Specify string format arguments as logging function parameters (logging-not-lazy)
openstack_dashboard/settings.py:412:24: W0122: Use of exec (exec-used)
openstack_dashboard/dashboards/identity/domains/workflows.py:476:44: W0640: Cell variable group_id defined in loop (cell-var-from-loop)
openstack_dashboard/dashboards/identity/projects/workflows.py:906:49: W0640: Cell variable group_id defined in loop (cell-var-from-loop)
openstack_dashboard/dashboards/admin/networks/views.py:42:0: W0404: Reimport 'views' (imported line 28) (reimported)
openstack_dashboard/api/swift.py:204:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
openstack_dashboard/api/swift.py:214:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
openstack_dashboard/api/cinder.py:248:30: W0631: Using possibly undefined loop variable 'cinder_url' (undefined-loop-variable)
openstack_auth/backend.py:123:28: W0631: Using possibly undefined loop variable 'plugin' (undefined-loop-variable)
openstack_auth/backend.py:129:39: W0631: Using possibly undefined loop variable 'plugin' (undefined-loop-variable)
openstack_auth/backend.py:131:39: W0631: Using possibly undefined loop variable 'plugin' (undefined-loop-variable)
openstack_auth/views.py:39:0: W0611: Unused Login imported from openstack_auth.forms (unused-import)
horizon/exceptions.py:348:8: W0125: Using a conditional statement with a constant value (using-constant-test)
horizon/tables/base.py:353:12: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)

Change-Id: Icf4f22abda77c9dbf98c780de876b7836c31d669
2019-01-15 00:22:27 +09:00
manchandavishal c02b9fc2dd Get rid of keys() usage
for x in some_dict.keys() can be written as for x in some_dict

Change-Id: If5436647a30c02d0dab7daa23b2290456c66d654
2018-11-30 11:15:27 +00: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
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
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
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
Kenji Ishii ad6c1410e6 Follow-up patch of bug: #1527457
The patch below was merged before addressing some comments from Akihiro.
https://review.openstack.org/#/c/259283/6
This patch will address them.

Change-Id: Iaf2aec3265a9f075f434ad5bce8ee6a2e3dd5fc5
Related-Bug: #1527457
2016-02-08 01:11:19 +00:00
kenji-ishii 4ff448b999 Modify 'admin' used by fixed string
When we do "member update" on domain and project page,
'admin' role is used by fixed string in internal processing.
However, since kilo we can use OPENSTACK_KEYSTONE_ADMIN_ROLES
and it mean the list of roles that have administrator
privileges. So this patch modify to use this setting.

Change-Id: I3817b168e7ac448997f41c1a4f4b3a3606994297
Closes-Bug: #1527457
2016-01-15 15:12:32 +09:00
Jingjing Ren 1ccc4dd14a Fix bad performance when editing domain members
Modify the Edit action use get_domain_user_roles API
instead of making a separate call for each user.

Change-Id: I9a37cf0d74b8a5ef6e1a6d4013a2b6826649f0c2
Related-Bug: #1365685
Closes-Bug: #1445249
2015-12-09 11:05:56 +00:00
lin-hua-cheng 0cde6aa055 Move to hacking 0.10
Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H307, H803 and H904 has been removed.

Fix code issues with H238 and W292.

Change-Id: I747ebb64db5825bc70f1ae19c1c1f5ca2089c06d
2015-02-04 20:27:07 -08:00
Akihiro Motoki 05068093a5 Fix E127 errors in other openstack_dashboard/dashboards/
E127 continuation line over-indented for visual indent

Partial-Bug: #1375931
Change-Id: Idad463a925d622908662942dc8a58ce888242f28
2014-10-11 13:33:28 +09:00
Cindy Lu d114dfe009 Reduce height for "Description" text areas
Textarea widget defaults to 10 rows which seems unnecessary.
Reduced to 4.

Change-Id: I03cfd0087ffb1225c6ce893d98481a9a66e2ab3c
Closes-Bug: #1370271
2014-10-06 16:20:43 -07:00
Jenkins b0bcb0e354 Merge "Domain Role assignment to Users" 2014-09-01 09:04:31 +00:00
Ashish Chandra 80d05a5c3d Improve help messages on modals
Some general guidelines:
1. Removed contractions
2. Changed "Info" to "Information"
3. Removed the "From here you can..." at the beginning of messages.
4. Explained concepts to users instead of just reiterating the modal
title. Thanks Jeff Calcaterra!

Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Closes-Bug: #1329984

Change-Id: I35af81953cafcbafc28c31b3ce305e8c5e21fe84
2014-08-27 16:12:18 -07:00
lin-hua-cheng 7a7a1d1c61 Domain Role assignment to Users
Added Domain User step in the Domain Update workflow for managing
domain-role assignment to User.
Change-Id: I629449c635319e3a4292a4e2be35c5d9fc8a7cf9
Implements: blueprint user-domain-role-assignment
2014-08-22 23:56:40 -07: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