Commit Graph

66 Commits

Author SHA1 Message Date
Brian Rosmaita b58ac2894b Drop cinder v2 API support
Cinder v2 API is deprecated since pike release. Along with the removal
of cinder v2 API support in cinderclient (change I335db5c1799e drops
v2 support), this commit drops cinder v2 support in horizon.

The next release of python-cinderclient drops v2 support,
so horizon needs to use v3 classes.

Includes a workaround in unit tests for two cinderclient.v3 classes
that are missing in the cinderclient releases prior to 8.0.0.  The
workaround can be removed once cinderclient change I335db5c1799edb2
is merged and released.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Iab0f097fab6696462572dc6ea53767c91e5411b1
2021-07-19 08:00:58 -04:00
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
Ivan Kolodyazhny ee6fa9a245 Remove Keystone v2 related code
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.

* Functions which just return horizon settings are dropped and
  the settings are referred directly now.
* The service catalog in the sample test data is updated to match
  the format of the keystone API v3.
* Related to the above change of the sample service catalog,
  openstack_dashboard.test.unit.api.test_keystone.ServiceAPITests is
  updated to specify the region name explicitly because 'RegionTwo'
  endpoint is no longer the second entry of the endpoint list in the
  keystone API v3.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ib60f360c96341fa5c618595f4a9bfdfe7ec5ae83
2020-04-23 11:43:12 +09:00
vmarkov 7f849239ea Support for Keystone password_lock option
This feature was added in Keystone V3 API. Proposed patch adds support
to Horizon

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Closes-bug: #1766485
Change-Id: Ic20a58c76826d703b43fa6a2d77ae5f77dcda1f4
2020-04-10 13:22:53 +03:00
白子玉 3f7fc68085 Changed default identity url to horizon
The keystone doesn't use 5000 port anymore from Newton version. And all
 the references should be changed together.

Change-Id: I3f02686ab5b3abf48f129fde92e90427ca148317
2019-12-06 18:41:38 +08:00
David Gutman 6e754e5dad Display users with role through group in users project details tab.
In the users tab of the project details view, the users
table displays now the users which have a role on the project
through a group. ie: if a group is member of the project, and
if a user is a member of this group, then it will be displayed
in the table even if it is not directly a member of the project.

An extra column is added to the table: "role from group" which
display the list of "role(group)" the user has on the project.

To be able to test the membership of user to a project through
a group, "user_group_membership" data has been added to keystone
data.

Change-Id: I968bad7d285acfaf7a8ccd7458593bbcad498ce2
Partial-Bug: #1785263
2018-09-12 13:40:38 +02:00
Akihiro Motoki c6611abe16 Update keystone v3 admin URL in UT
We no longer use port 35357 for keystone v3 API admin operation
and it is recommended to use port 5000.
This commit updates keystone catalog for keystone v3 API.
It also replace keystone v2 URL with v3 one.
Note that keystone v2 data is kept as-is.

Change-Id: Ia152d602b80ae418e0020b3ba30a11016a83da6a
2018-08-14 02:50:47 +09:00
Colleen Murphy 2d69444bad Add support for application credentials
This patch adds support for creating application credentials in
keystone[1]. Application credentials can be created by any user for
themselves. An application credential is created for the currently
selected project. A user may provide their own secret for the application
credential, or may allow keystone to generate a secret for them. After
the application credential is created, the secret is revealed once to
the user. At that point they may download a clouds.yaml or openrc file
that contains the application credential secret and will enable them to
use it to authenticate. The secret is not revealed again.

[1] https://docs.openstack.org/keystone/latest/user/application_credentials.html

bp application-credentials

Depends-On: https://review.openstack.org/557927
Depends-On: https://review.openstack.org/557932
Change-Id: Ida2e836cf81d2b96e0b66afed29a900c312223a4
2018-04-26 09:32:00 +02:00
Ivan Kolodyazhny a774fa30dd Use Cinder API v3 by default
Cinder API v3 was introduced several releases ago and is backward
compatible with API v2 so it's safe to swith to use it.

Change-Id: I550e6c59bb14c17da78d7b2abcde5783b2b6825d
Closes-Bug: #1728761
2017-12-18 15:34:41 +02: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 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 8ce29a42c7 Merge "Fixes traceback if group name attribute is missing" 2016-12-08 20:55:57 +00:00
Jenkins e83069a2c3 Merge "Make default domain usage consistent" 2016-12-02 01:17:18 +00:00
Colleen Murphy 2c104cc770 Make default domain usage consistent
The description for the OPENSTACK_KEYSTONE_DEFAULT_DOMAIN django
variable claims it refers to the ID of the domain. However, the
authenticate method of django_openstack_auth explicitly uses the name
when it requests a token[1], and when multidomain support is enabled
the user is asked for the domain name, not ID. If the operator tries to
set this variable to the ID of any domain besides keystone's own
Default domain, login will fail with "Could not find domain: <domain
ID>" in the keystone logs.  This patch forces horizon to use the
variable as a name instead of an ID and updates the comment, so that
everything using this variable is consistent with each other.

This wasn't caught before because the unit tests were only testing
against the default domain, so this patch also adds a second, enabled,
non-default mock domain to test with.

[1] http://git.openstack.org/cgit/openstack/django_openstack_auth/tree/openstack_auth/backend.py?h=2.4.1#n148

Change-Id: I4d16f831c9fc446859c9fb964b7609d5a76338fe
2016-11-28 12:41:06 +01:00
David Lyle 20ea82b9ef Removing deprecate ceilometer code
The ceilometer code has been deprecated and disabled for
several cycles. Now removing the code.

Change-Id: I1dcfb8aae6ce6898cb46f6312731a92a01ae0b67
2016-11-17 16:52:13 -07:00
Edmund Rhudy cb664ecf18 Fixes traceback if group name attribute is missing
This works around an issue where certain backends (e.g. LDAP)
did not provide a group name, only ID, which would cause most
identity management tasks in Horizon to fail. If no name is
provided, the ID is duplicated as the group name.

Change-Id: Iea87abf38d26cb2baff43521c7dd2ae0a00e9997
Closes-Bug: #1593571
2016-08-23 09:53:46 -04:00
Jenkins 70596b1d00 Merge "[Django] Allow to upload the image directly to Glance service" 2016-08-18 03:38:55 +00:00
zhangyanxian d52631534b Fix typo in keystone_data.py
TrivialFix

Change-Id: I9cb576b47a645d96f57481ea3c4230efbd16b4bd
2016-08-17 02:58:47 +00:00
Timur Sufiev 93af461e40 [Django] Allow to upload the image directly to Glance service
Since large Glance images even temporarily stored on dashboard side
tend to fill up Web Server filesystem, it is desirable to route image
payload directly to Glance service (which usually streams it to
storage backend, which in turn has plenty of space).

To make it possible we need to trick Django into thinking that a file
was selected inside FileInput, while its contents are not actually
transferred to Django server. Then, once image is created client-side
code needs to know the exact url the image payload needs to be
transferred to. Both tasks are solved via using ExternalFileField /
ExternalUploadMeta classes which allow to work around the usual Django
form processing workflow with minimal changes to CreateImage form
business logic.

The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard) and restart glance-api process.

A progress bar is implemented to track the progress of a file upload,
in case a really huge image is transferred.

The new machinery could be easily switched on/off with a single
setting `HORIZON_IMAGES_UPLOAD_MODE` set to 'direct' / 'legacy'.

Related-Bug: #1467890
Closes-Bug: #1403129
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I01d02f75268186b43066df6fd966aa01c08e01d7
2016-08-16 14:30:38 +03:00
Timur Sufiev 7e65af5f13 Embed support for external data sinks into api.glance
In case 'data' image attribute is a base string (instead of in-memory
or on-disk file), api.glance sends back an image wrapper with a redirect
url and a token to its caller, so the caller could upload the file to
that url directly.

Provide a unit test for api.glance behavior when an external upload
location is used. That also requires to fix glance stub endpoint data
in keystone_data.py since it didn't reflect the reality.

Also document the new HORIZON_IMAGES_UPLOAD_MODE setting that will
govern direct images upload and the define approach to deprecating the
old HORIZON_IMAGES_ALLOW_UPLOAD setting. The old setting is deprecated
as of Newton release and planned to be removed in P. 'Removing' means
that it will no longer be used / referenced at all in code, not the
actual presence in settings.py (it is removed from settings.py in this
commit). What really matters is if the customized value of
HORIZON_IMAGES_ALLOW_UPLOAD in local_settings.py will be still
considered during the deprecation period.

Help text in Django Create Image form in case if local file upload was
enabled was wrong, fixed that.

Related-Bug: #1403129
Partially implements blueprint: horizon-glance-large-image-upload

Change-Id: I24ff55e0135514fae89c20175cf9c764e871969b
2016-07-26 13:38:58 +00: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
lin-hua-cheng 2ce5de16ee Add support for identity provider protocol CRUD
Add the protocol tab under the Identity Provider detail
panel, this allows the user to manage the protocol on
the context of the Identity Provider,

Change-Id: I0e232b174382b1bc325e04cc343ae4d50e0cfed1
Implements: blueprint keystone-federation-protocol-mapping
2016-02-16 16:04:48 -08:00
Victor Stinner 68de571097 Port identity provider dashboard to Python 3
* Fix usage of Mapping() of keystoneclient.v3.contrib.federation:
  pass a manager instance, not a manager class.
* Simplify DataTable.get_object_display().
* tox.ini: add identity_providers to Python 3.4.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Closes-Bug: 1543073
Partial-Implements: blueprint porting-python3
Change-Id: I066359734624023b3f3776e8dbd54237d298e455
2016-02-09 10:29:06 +01:00
lin-hua-cheng fbf10e9dad Add basic CRUD for federation mapping
Change-Id: Ie3991efda6d2437821f67e3c87e111886578e830
Partially-Implements: blueprint keystone-federation-mapping
2016-02-04 00:10:46 +00:00
lin-hua-cheng 6ecc3d2973 Add support for identity provider management
Display the identity provider panel when the setting
OPENSTACK_KEYSTONE_FEDERATION_MANAGEMENT is set to True.

Change-Id: Iadf92eb7542013f9c212eccfa372c6335a319841
Implements: blueprint keystone-federation-idp
2016-01-21 18:40:13 -08:00
David Lyle 9a58663fae Excise Trove from Horizon
With the merging of https://review.openstack.org/256605/
https://git.openstack.org/openstack/trove-dashboard exists and
contains the content previously integrated in the Horizon
repository.

Change-Id: Ic742f054f629a6fa078cf1e6eb137f5f8da7089d
2015-12-22 02:01:07 -07:00
Jenkins 156cc7b948 Merge "Excising Sahara from Horizon" 2015-12-05 09:48:11 +00:00
Itxaka 89224df8d8 Fix typo in test data for keystone
"test_decription" instead of "test_description"

Change-Id: I2f09ec381e2609a647040d03b020b554d769fe26
Closes-Bug: #1522724
2015-12-04 09:22:43 +01:00
David Lyle 4fbe4af80e Excising Sahara from Horizon
The content is proposed to the openstack/sahara-dashboard repo.

Change-Id: Ie76b09b9bdbdb975c1cd39658f02bcf95b98b961
2015-12-03 22:52:23 +03:00
Canh Truong cbd63f27e4 Add description field in the user table
In the user table, description column is missing when using keystone V3
This patch add the 'Description'column in User table. This also
change to add 'Description' field the user_create and user_update form.

Change-Id: I90bb7a644f8f29ae0055c6c2ffc688a9b709f300
Closes-Bug: #1463247
2015-06-24 11:22:22 +07:00
Chad Roberts f4781d8796 Fixing permissions for data processing panels
Recently, the data processing service was renamed to
"data-processing" rather than "data_processing".  Each
panel needs to be updated so that it will show up when
the data-processing service is enabled.  Also updated
the underlying test data to reflect the update.

Change-Id: I38d7350215cbe5c5f406d75d6be7c9057957bc69
Closes-Bug:  #1429987
2015-03-09 17:17:22 -04:00
Gary W. Smith dca7117fdf Permit using latest python-cinderclient
Fix a number of unit tests so that they will work with the latest
cinderclient, which will be released by the end of Kilo.

The problem was that several horizon unit tests made calls into
python-cinderclient that should have been stubbed out (but were not).
These calls silently did nothing in the released python-cinderclient due
to a "feature" where certain GET functions would return an empty list
when the auth url was an empty string, instead of returning an auth
failure.  Recent changes in the python-cinderclient authorization
functions closed this hole, which then revealed problems in the horizon
unit tests:
1) several tests were lacking stubs to cinder calls, and
2) the auth url in test of cinderclient v2 was empty due to a missing
   dictionary entry in test_data/keystone_data.py

Change-Id: I33967a924f4e47009fdc1613248afd1bd377f34f
Closes-Bug: 1423425
Co-Authored-By: Richard Hagarty <richard.hagarty@hp.com>
2015-03-03 15:45:52 -08:00
George Peristerakis aa3dc6b30b Added a modal dialog with the user credentials details
The modal contains all the credentials used to access the user's
openstack and EC2 instance.

Change-Id: I750b2922a34dd06b2098eff95d817c852a18be07
Implements: blueprint api-access-page-enhancements
Co-Authored-By: Cédric Soulas <cedric.soulas@cloudwatt.com>
2014-11-13 14:54:21 -05:00
Akihiro Motoki 832a741c88 Fix E128 errors in remaining openstack_dashboard/
E128 continuation line under-indented for visual indent

Closes-Bug: #1375929
Change-Id: I2a72313d359bdfe2e2667eba5d3bf9744ec8f60a
2014-10-16 16:53:52 +09: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
Jenkins 8c9b86f130 Merge "Fixes bad performance when editing project members" 2014-07-23 13:03:07 +00:00
Jamie Lennox 821619fff3 Replace UserManager with None in tests
Don't access keystoneclient's UserManager in tests. This should be
considered private data of keystoneclient and is not actually used by
horizon tests.

Change-Id: I261e79b31dfc7388adb3dc63a3a5e54042f05e54
Closes-Bug: #1347236
2014-07-23 08:55:55 +10:00
Rodrigo Duarte Sousa ed43be0a0f Fixes bad performance when editing project members
The bug is caused by consecutive client calls when
fetching users' roles in a project.

The fix was to use the /v3/role_assignments endpoint.
Which retrieves all roles in a single client call
(dashboards/admin/projects/workflows.py:
UpdateProjectGroupsAction and UpdateProjectUsersAction).

The compatibility to the previous keystoneclient version
is maintained.

In a scenario with 1000 users with a role in a project
(using devstack), the time to render the Modify Users
page dropped from 45s to 2.5s

Change-Id: Ic72ebea0db226faf98c5e04d00d76dedd1fb01c1
Closes-bug: #1278920
2014-07-01 12:10:20 -03:00
Chad Roberts 7c3897a4bd Adding plugins panel for Sahara
The plugins panel is used to show the various
hadoop flavors/versions that are supported by the
underlying Sahara API.
* also added basic panel tests
This code was originally from:
https://github.com/openstack/sahara-dashboard

Change-Id: Ib0c95334a5122529fddbfd9c0cd0d0c06e0c8ad3
Partial-Implements: blueprint merge-sahara-dashboard
Co-Authored-By: Nikita Konovalov <nkonovalov@mirantis.com>
Co-Authored-By: Dmitry Mescheryakov <dmescheryakov@mirantis.com>
2014-07-01 09:29:07 -04:00
Julie Pichon 77dcd64341 Basic support for Cinder v2
Change-Id: I6540720866c9005cf9537fe5b3a241f769529b3a
Implements blueprint: cinder-v2-horizon
Closes-Bug: #1226944
2014-03-03 15:42:23 +00:00
Alejandro Emanuel Paredes 311bbd7d16 Empty email for users gets saved as an empty string
The actual behavior is that horizon sends an empty string
on the "email" field when creating a new user if the field
isn't filled by the user.
To match the keystone client behaviour, instead of sending
an empty string, this patch sends a "None" value when the
field isn't filled by the user.
By doing this, when creating a new user from both,
keystone client and horizon, a "null" value is stored
under the same conditions.
in the database. This will keep the data consistency.
From the presentation point of view, when a "null" value
is received, it is presented as an empty string instead
of showing "None" on the "email" field of the users table.

Change-Id: Ib5df774b3fe9d82c084f380c9c11aea46b2984aa
Closes-Bug: #1265805
2014-01-14 09:35:47 -05: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
Alex Gaynor f359c66e09 Fixed a PyPy compatibility issue in the test fixtures
This construct didn't work under PyPy, as a result of the fact that
datetime is implemented in Python in PyPy:

A simplification of the problem is this:

import datetime

class X(datetime.datetime):
    pass

now = datetime.datetime.now()
X.isoformat(now)

This works under CPython, but fails under PyPy. This is because PyPy
creates a normal unbound method for `X.isoformat`, which checks that
`now` is an instance of `X`, which it isn't. Because datetime is
implemented in C, CPython skips those checks.

Change-Id: Id27e7a8b00156bd9688bdb36d2c38b04785c2d0c
2013-09-14 10:41:29 -07:00
simon ec727ac394 PEP8 E121 has been resolved
Change-Id: I6ad2704100447c5a3be12c2ebeec824726e3bd0b
Partial-Bug: #1085346
2013-09-05 14:38:58 +08:00
Robert Myers 8c1bc54f93 Adding panels for trove
* Add python-troveclient to requirements.
* Add trove api to openstack_dashboard apis.
* Add Database Instances panel.
* Add Database Backups panel.

Authors:
* Robert Myers
* Denis Makogon
* Andrea Giardini

Implements: Blueprint trove-support

Change-Id: I0541534612ccb491d692168c3c9ca7a841650be6
2013-08-31 23:27:46 -05:00
Lin Hua Cheng ff3071612f Fix the Domain context for Projects panel
Add display of Domain ID and Domain Name in the Create and Update
Projects page to give user a hint where the Project will be created.
For Keystone V2, the two fields will be hidden.

When the Domain Context is set, the Project will be created in that
Domain Context. Otherwise, the Project will be created in the Domain
of the logon user.

On project creation, the listing of available users and groups will
be based on the Domain where it will be created. While on project
update, the listing of available users and groups will be based on
the Domain of the Project.

Fixes bug 1215196

Change-Id: Ia2ab25956621d01c2173e08402241b7f60401e0f
2013-08-28 23:19:49 -07:00
Ladislav Smola 69d67c08ab Add ceilometer api and the tests for it
Adding ceilometer api basic function wrappers.
Adding Class wrapper of each ceilometer object.

Adding ceilometer general usage wrappers for common statistics over
list of Resources and ResourceAggregates.

Adding specific table statistics wrappers.

Adding tests and test data for Ceilometer API.

Best to be tested with commit for resource usage panel at:
https://review.openstack.org/#/c/35590/ - this commit is for the
test purpose only.

Link to bp: https://blueprints.launchpad.net/horizon/+spec/ceilometer

Implements bp ceilometer.
Change-Id: I5b3392de8bae2be8cbcba7a580af669676e54052
2013-08-28 19:21:37 +02:00
Tatiana Mazur 17f18f6316 Small cleanup in "test_data"
This patch set replaces a few method imports with
module imports in "openstack_dashboard/test/test_data".

Fixes bug 1215996

Change-Id: I3268d61044f31e7adca5ae752b4768df0e7fbbec
2013-08-23 19:31:09 +04: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
Lin Hua Cheng 353bb14ec1 Implement assignment of Project Roles to Group
Added Project Groups step in the Project workflow for managing
project-role assignment to Groups.

The feature is only enabled if the application is running KS V3.

Moved the logic for filtering Groups by Domain into keystone.py.

Change-Id: I48b1aba162646a5327f6442a864e2015596a99c6
Implements: blueprint group-role-assignment
2013-08-20 11:40:12 -07:00