Commit Graph

52 Commits

Author SHA1 Message Date
Matt Crees 86f5b9012e Support SSL verification in creating Blazar client
Adds support for SSL verification when ``OPENSTACK_SSL_CACERT`` is set.
Explicitly skips verification if ``OPENSTACK_SSL_NO_VERIFY`` is set.

This also switches to Session-based instantiation for the Blazar client,
away from the deprecated url+token method.

Closes-Bug: #2045281

Change-Id: I94aad7590b1e42ddfa1a20fdb184ca4d73587cd6
2024-02-13 23:18:40 +00:00
Matt Crees 6c6caa3be6 Fix removed Django function calls
``ugettext_lazy`` and ``ungettext_lazy`` have been removed in Django
v4.0 [1].

1. https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation-removed-in-4-0

Change-Id: Iaa809aa3698bb0a32293c1de430b57f33d7e6104
2024-02-12 15:37:48 +00:00
manchandavishal 837eb58428 Address RemovedInDjango40Warning
In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path(). For more info see [1]
These were already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2
[2] https://review.opendev.org/c/openstack/horizon/+/827093

Change-Id: I71e21300e6c072f790ae0517bb40d18b01a4a23b
2022-04-29 22:00:57 +05:30
Pierre Riteau fb9ae6e2c2 Display error details
The red error box will now show why a lease failed to be created or
updated, for example if not enough resources are available.

Also remove "Please try again" which is not a helpful message.

Change-Id: Id0b39fd151956ae6b08ab503a7ae0c5dc09af7f6
2022-02-15 12:35:58 +01:00
Mark Powers d6398f5e7a Add a resource availability calendar for hosts
This adds a calendar view where users can see a timeline of resources,
showing when each resource is reserved.

Implements: blueprint calendar-view
Change-Id: I4f2649d6c9538037dff4747ef4a8210da3666354
2022-01-27 16:06:50 +01:00
Lukas Euler 33c58438ab Use json.loads instead of eval for JSON parsing
Also fixed error messages.

Change-Id: I998d6929ad05d9b5bc4e07f27f3f9cbf2dd64c68
Closes-Bug: #1895688
2020-09-30 19:07:43 +02:00
manchandavishal f494ec1941 Cleanup for Refactor-error-messages
This patch is a clean-up patch for refactor-error-messages bp
which remove the exception message from base message otherwise
the same exception message display twice like
this https://ibb.co/XyFWMdz .

Change-Id: Ia9b66536afe2c0122b652c58d9e11235f962a71c
2020-08-26 11:45:59 +00:00
Hervé Beraud daf0e0d40c Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I3c11cfe1e5e87cd74e2b679aac906898ffdb1b27
2020-06-02 19:35:42 +02:00
Andreas Jaeger 26fda6b697 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build
- Cleanup doc/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme version
- Update hacking to version 3.0; remove hacking and friends
  from requirements, they are not needed; fix warnings found
- Use unittest.mock

Change-Id: I379c086a15477da4b0223fddd48035c829992c88
2020-04-16 15:23:47 +02:00
Andreas Jaeger d4136cf024 Remove six usage
This repo does not support Python 2 anymore, so we don't need
six for compatibility between Python2 and 3, convert six usage to Python
3 code.

Change-Id: I48967b4e792dccade818389bf43707cde2e15c2b
2020-01-16 10:22:08 +00:00
jacky06 39e9ba4f2c Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I67df079c0a61099f5728a7d9cd7a186ec14b2741
2019-06-03 12:45:59 +00:00
Masahito Muroi 4064094918 Support Affinity Rule column in the Virtual Instance Resource Type
Blazar supports True and None for the affinity key in the instance
reservation from Stein release. This patch follows the change in
the blazar dashboard.

Closes-Bug: #1821168
Change-Id: Ibceef87ee717cd978e38765bde80e8294a69833d
2019-03-28 04:57:21 +00:00
Pierre Riteau 52b1dac890 Remove outdated code
This code doesn't match the new lease status introduced in Queens and is
not used anywhere anyway.

Change-Id: I1189f149aff4407f00dbb890c3f0e02a0aa79a14
2018-09-06 13:34:43 +01:00
Chuck Short 1ff2f7a2a4 Remove dead code
Now that mox has been removed we can remove the create_stubs
helper function as well.

Change-Id: Ie240357a4ff6346a4acfa6efcbb1c8d2f16f3c5a
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-27 07:56:34 -04:00
Zuul b27860f6fc Merge "Support resource_properties key in instance_reservation" 2018-06-05 06:04:02 +00:00
Hiroaki Kobayashi 434c34d495 Support resource_properties key in instance_reservation
Partially Implements: blueprint flavors-extra-specs
Depends-On: https://review.openstack.org/563149

Change-Id: I3c00bd366027465d349f1a0c83fe8290d9b2fa22
2018-05-14 17:44:25 +09:00
Akihiro Motoki cff0dc4884 Django 2.0 support
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 deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

Add py35dj20 job to test Django 2.0 integration.
Also drops older Django unit tests from tox.ini
as horizon dropped Django <=1.10 support in Rocky.

Change-Id: I099c7b019c930307d3aae64b1729d6f532fc1653
2018-05-10 23:09:55 +09:00
Hiroaki Kobayashi 860958bcee Remove mox usage
Partially Implements: blueprint mox-removal
Change-Id: Ibc87064e1e2348ff645e5ce34bd27a652cb56bd8
2018-04-26 11:55:30 +09:00
Hiroaki Kobayashi 607f3bdc1c Sort reservation parameters
This patch changes the reservation view in the detailed view of a lease.
General reservation parameters are shown first and resource specific
parameters are shown after them.

Change-Id: I6b3d91370c26332bba5452a28be3020653fd11fd
Closes-Bug: #1711554
2018-04-10 14:38:57 +09:00
Zuul f1e2cd6d12 Merge "Add reservations parameters for the lease update form" 2018-03-02 16:37:13 +00:00
Zuul 9310432b3c Merge "Add a reservable field of Hosts" 2018-02-27 11:05:26 +00:00
Hiroaki Kobayashi ec9345c1c5 Add a reservable field of Hosts
Partially Implements: blueprint resource-monitoring
Depends-On: Id98c8d956f36ce5ae9fcecef9e1d181a208d3e3a

Change-Id: I76decd57003fec63feefd194f7f04003b280a66e
2018-02-21 07:07:32 +00:00
Hiroaki Kobayashi c3e16dfed0 Remove unused status related fields
The action and the status_reason fields are not used in the latest
state-machine. This patch stops showing these unused fields.

Partially Implements: blueprint state-machine

Change-Id: I14e7e2c545c37f215c0303d6906748f4d5a120ab
2018-02-21 07:06:46 +00:00
Hiroaki Kobayashi e43b1e9957 Add reservations parameters for the lease update form
Change-Id: I67ec602e25d02be38ae6673b0c3cb132d9729494
Closes-Bug: #1714119
2018-02-14 01:00:00 +00:00
Hiroaki Kobayashi 1b1f50f470 Add the new degraded field to Leases
Partially Implements: blueprint resource-monitoring
Depends-On: Id98c8d956f36ce5ae9fcecef9e1d181a208d3e3a

Change-Id: I4d373b6890e12cebefd3e320eb69c7fb3f442ff3
2018-02-13 10:10:59 +00:00
Hiroaki Kobayashi 0c286007c3 Use OpenStack documentation standards / Nova hypervisor-list API
This patch updates documents for aligning with OpenStack documentation
standards which include using the openstackdocstheme.
This patch also replaces Nova host-list API calls with hypervisor-list
API calls because the former was superseded by the latter [1].

These changes are not related but squashed into one patch for passing
gate tests.

[1] https://docs.openstack.org/releasenotes/python-novaclient/queens.html#id4

Change-Id: I1fe652c17983f2b4505be50d01a26678bf50ef29
Partial-Bug: #1721489
2018-02-13 09:19:21 +00:00
Zuul 983f3919a0 Merge "Fix display of host details when cpu_info is empty" 2017-11-21 04:40:05 +00:00
Zuul 386f13159e Merge "Add titles to "Update Lease" and "Update Host" forms" 2017-11-20 04:29:38 +00:00
Nick Timkovich 7bf6e72692 Add titles to "Update Lease" and "Update Host" forms
This presents a more uniform style when looking at the modal forms.

Change-Id: If162ce4c2fcda845d7e233bb52669aeab2d73df5
2017-11-16 21:40:59 +00:00
Nick Timkovich 2cdf658bf8 Fix formatting of cancel button on update forms
"Cancel" appears large and grey, styled like the X to close the form. It
also needs to appear before the "Update" element in the source,
otherwise there is no spacing between the two buttons.

Change-Id: Idd03e1a178523b07d644b54e5e48a40b5f3f8c60
2017-11-16 21:23:45 +00:00
Pierre Riteau 8066409cda Fix display of host details when cpu_info is empty
If a Blazar host was created with an empty cpu_info value, displaying
host details would fail with the error:

    SyntaxError: unexpected EOF while parsing (<string>, line 0)

This is because calling eval() on an empty string raises a SyntaxError.
This patch ensures that if cpu_info is empty, it is set to an empty
dictionary instead.

Change-Id: I38d9f92fd7937de4ec1492d06ddea834b6c423ef
2017-11-14 15:52:36 +00:00
Zuul ee40700175 Merge "Support a host update operation" 2017-11-02 09:38:29 +00:00
Zuul a2cba83d7a Merge "Add extra capabilities for create host" 2017-11-02 09:38:28 +00:00
Zuul 43309a8532 Merge "Support a host create operation" 2017-11-02 09:38:28 +00:00
Zuul 2783ed798f Merge "Support a host delete operation" 2017-11-02 09:37:41 +00:00
Zuul 640af94061 Merge "Add a detailed view of a Host" 2017-11-02 09:35:11 +00:00
Zuul aedf9e3aa0 Merge "Add a Hosts panel to the admin dashboard" 2017-10-31 07:46:08 +00:00
Hiroaki Kobayashi eb4fd86d82 Support a host update operation
This patch adds an update host form to the blazar-dashboard.

Partially Implements: blueprint host-operation-with-dashboard

Change-Id: Ib8eec00ba652bd27c0ab9d9d28267d2cc23055e5
2017-10-23 11:32:01 +09:00
Hiroaki Kobayashi 172f86a253 Add extra capabilities for create host
Partially Implements: blueprint host-operation-with-dashboard

Change-Id: If23e29b032207e3821eac2106dfb029914cad966
2017-10-23 11:24:39 +09:00
Hiroaki Kobayashi e4b9888a6b Support a host create operation
This patch adds a create host workflow to the blazar-dashboard.

Partially Implements: blueprint host-operation-with-dashboard

Change-Id: Idaf142a947963d3cccaf94e3e611fe7c9bcebf94
2017-10-20 18:45:39 +09:00
Hiroaki Kobayashi f34cf85105 Support a host delete operation
This patch adds a host delete support to the blazar-dashboard.
Push the Delete button in the list view and you can delete a host.

Partially Implements: blueprint host-operation-with-dashboard

Change-Id: Id3faf448c8afbde379780884f7cbbad442b55115
2017-10-20 15:58:09 +09:00
Hiroaki Kobayashi ee000d7a0e Add a detailed view of a Host
This patch adds a detailed view of host information. Click a host name
in the list view and you can see the detailed view.

Partially Implements: blueprint host-operation-with-dashboard

Change-Id: I6ee0286f1f79f151b9908d4952d54f5ba748b7ad
2017-10-20 15:57:40 +09:00
Hiroaki Kobayashi 6afd13a148 Add a Hosts panel to the admin dashboard
This patch adds a new 'Hosts' panel to the admin dashboard. This panel
is grouped in the 'Reservation' group. Only a list view of hosts is
currently supported.

Partially Implements: blueprint host-operation-with-dashboard

Change-Id: I691fa53de4de1e3fbf367eba2f997cd6cafba875
2017-10-02 19:16:08 +09:00
Hiroaki Kobayashi c2936fc45c Add validation check for the start/end time of the update form
Change-Id: I1f3d5bc20507aa209bf1a8671df1881de2776266
Closes-Bug: #1710020
2017-08-31 15:14:31 +09:00
Jenkins 0d6c547552 Merge "Support creation of instance reservation" 2017-08-18 12:16:38 +00:00
Jenkins 561fb6a230 Merge "Show reservations in more detail" 2017-08-18 12:13:45 +00:00
Jenkins 773393a704 Merge "Support lease creation" 2017-08-18 09:56:56 +00:00
Hiroaki Kobayashi 0d81e1b86a Support creation of instance reservation
Change-Id: Ie5d20b2f44e099fe46a1c59a7e823a3b115aab34
Partially Implements: blueprint climate-dashboard
Depends-On: I8065118fca5588e89888ef11888696886573d379
2017-08-18 09:48:43 +00:00
Hiroaki Kobayashi 55b4cf4ed0 Show reservations in more detail
This patch changes the template of detail view to show more detailed
information of reservations.

Partially Implements: blueprint climate-dashboard

Change-Id: Iae34757bb870e84fb6a58eebe6b04da470d22688
2017-08-18 09:48:14 +00:00
Hiroaki Kobayashi 6ab330c514 Support lease creation
This patch adds a lease creation feature to the Blazar dashboard.

Change-Id: Id078c570122e3de4d4569023f85a94af7ccaa05b
Partially Implements: blueprint climate-dashboard
2017-08-08 18:00:03 +09:00