Commit Graph

144 Commits

Author SHA1 Message Date
Corey Bryant ec1d07f7e6 Django 4.x: Address RemovedInDjango40Warning
force_text() is deprecated in favor of force_str()
and urlquote() is deprecated in favor of
urllib.parse.quote() in Django 4.0. For more please
refer [1].

[1] https: //docs.djangoproject.com/en/4.0/releases/4.0/

Co-Authored-By: manchandavishal <manchandavishal143@gmail.com>

Change-Id: Ibc97402b735c3ddbdd7a2174e14353dad34cbc22
2022-12-01 16:04:53 +05:30
Zuul 0c57fd76c4 Merge "Address RemovedInDjango40Warning" 2022-08-11 14:01:31 +00:00
Takashi Kajinami a5007ee3bd Replace deprecated ugettext_lazy and ungettext_lazy
The ugettext_lazy method and the ungettext_lazy method are both
deprecated since Django 3.0[1].

These were already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/3.0/releases/3.0/#id3
[2] cd7c1b5110fe1f64cd9dfbeb1072b37912d0efee

Change-Id: I90224714987c8583a8d407f661494479db4214af
2022-07-11 14:04:13 +09:00
manchandavishal e91ab23210 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: I3671c2bb499664997e18cd200d6293cb146895e3
2022-04-29 18:15:12 +05:30
Luigi Toscano 18921beb2e Test fixes: unittest.mock, better l-c job, pytest dep
Now only python 3 is supported, which means unittest.mock
can be used instead of the external mock module.
This change can be done thanks to the Horizon
change I2de669d8e89b8daeb7ee5405ffab35af6307c40b

Switch to openstack-lower-constraints-jobs-horizon
which pulls in the last horizon. The lower-constraint
version of horizon should be bumped when a new
version (post-18.2.0) is released.

Finally, add pytest to the set of test requirements
to prevent an missing import error (even through
the sahara scenario tests still need to be ported
to pytest).

Change-Id: I2c61e9d88b2d05c9f0b68066d7bb15b43cdf083f
2020-04-15 17:59:11 +02:00
Andreas Jaeger 24e6863ba7 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Remove hacking and friends from lower-constraints, it's not needed
there for co-installing.

Change-Id: I3d250ba82cc14f163f4295381b9b9c232486ac9f
2020-03-31 17:38:17 +02:00
manchandavishal 3584317a46 Use Horizon project template for django jobs
Horizon defined a project template 'horizon-non-primary-django-jobs'
for django jobs. This patch use that template to run django jobs
here and fix the failed test cases for django2.2 support by replacing
None with an empty string and add renderer argument.
For information please refer [1], [2], [3].

[1] https://review.opendev.org/#/c/681969/
[2] https://github.com/django/django/commit/6fe9c45b725
[3] https://docs.djangoproject.com/en/2.1/releases/2.1/#features-removed-in-2-1
Change-Id: I9a62bb0a56b16cd6caa6cc9bf7db9b85c99ed580
2019-10-18 17:48:25 +00:00
Andy Botting e1ae0f7143 Fix filter() usage for Py 3
The use of filter() within the codebase expected the output to be
an interator, but the filter function in Python 3 now returns a
lazy loading generator and resulted in stack traces.

This commit replaces the use of filter() (+ lambdas) with more
readable list comprehension to be compatible with Python 2 and 3.

Change-Id: I56af1dc1f6648ec334f901cb59893240b0125031
2019-08-13 15:35:14 +10:00
Jeremy Freudberg 1b2eab6d45 Bring now-deleted Horizon utils in-tree
Horizon commit 26eebd4abbbabc1475bae61c51d1cfcf14dba770 deleted some
needed functions.

Change-Id: Ia8787a65c110731f1dab9339f382b2680240cab3
Story: 2006179
Task: 35703
2019-07-10 09:56:23 -04:00
Jeremy Freudberg 29c0205bac Sync APIv2 changes into dashboard
- job_id->job_template_id in v2 jobs
- project_id->tenant_id
- Boot from volume enhancements

Story: 2003092
Task: 29741

Change-Id: Ie8e604d73c77a4e7672f87b95ecbe3c1de945293
2019-03-07 00:38:20 -05:00
Jeremy Freudberg 4585a9d004 One missed hadoop_version->plugin_version
Change-Id: I7696d4bda30c72d3930fe01790903ab814246771
2018-07-31 11:30:19 -04:00
Telles Nobrega 0dc65e9588 Boot from volume
Adding the boot from volume check on node group templates creation.

Change-Id: I7bcfca72615758a5534901cdf6a0960ae9bd9a6a
Story: #2001820
Task: #12560
2018-07-26 09:33:20 -03:00
Jeremy Freudberg 95aca19615 APIv2 in dashboard
Everything except decomission of a specific node.

Change-Id: Iaa02b91d75b51b812c7e5eaf8612a1d75e17748e
2018-07-17 15:26:54 -03:00
Luigi Toscano 56b69d6477 Goodbye mox - no more needed
The porting to mock of sahara-dashboard is complete.
This fulfills the community goal
"Remove Use of mox/mox3 for Testing" set for Rocky:
https://governance.openstack.org/tc/goals/rocky/mox_removal.html

Raise the requirement to the Rocky M2 release of Horizon,
which drops the usage of mox by default (it should be
explicitly enabled). Without a forced import from Horizon
the mox dependencies can be dropped here.
Bump also a dependency needed by this new version of Horizon.

Change-Id: Iaf272af9919f8a69562c0a469130bbf8628936cf
2018-07-04 19:38:21 +02:00
Charles Short 77bc890432 Remove mox3 from DataProcessingClusterTemplateTests
Apart of the mox3 community goal for rocky.

Change-Id: If0010e61e4f3c25c9800a8adc73ea1563366a34c
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-07-04 14:47:41 +02:00
Jeremy Freudberg 63a8350804 Fix _cls_registry type
Horizon commit e50a69d69f338d0ec66baa659a7d82e328e62a67 saw
_cls_registry become a list instead of a set. We need to reflect this
change, or else see:
  'set' object has no attribute 'append'

Change-Id: I302b6120145909fc4d342579818b05584a0820a3
2018-06-14 09:53:55 -04:00
Zuul 0510d91011 Merge "Drop mox3 from DataProcessingNodeGroupTests" 2018-05-07 13:56:09 +00:00
Zuul 9114c2d7ec Merge "Remove mox from DataProcessingClusterGuideTests" 2018-05-04 17:21:52 +00:00
Charles Short 2de3365d86 Drop mox3 from DataProcessingNodeGroupTests
Apart of the mox3 community goal for Rocky.

Change-Id: I92895f919f26885752391b0ce37d98a146fa901d
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-05-04 10:28:58 -04:00
Charles Short 3227c74c3a Remove mox from DataProcessingClusterGuideTests
Apart of the mox3 community goal for Rocky.

Change-Id: Ib060e7be477868131b0dc6dcd12fbadc35d15d7c
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-05-04 10:17:21 -04:00
Zuul f9c21c3d2a Merge "Remove mox from DataProcessingClusterTests" 2018-05-03 18:17:00 +00:00
Charles Short 62544744de Remove mox3 from DataProcessingImageRegistryTests
Apart of the mox3 community goal for Rocky.

Change-Id: If3956d0e16f3fc32a862d836142d2d7a71c946b5
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-04-30 19:20:27 +00:00
Charles Short d99c744c21 Remove mox from DataProcessingClusterTests
Apart of the mox3 community goal for Rocky.

Change-Id: I45fb50f511cc566306cd3e9badd3f2aa64595580
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-04-30 19:20:08 +00:00
Luigi Toscano da5df29dfe Port away from django.core.urlresolves to django.urls
The old location was deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
and totally removed from Django 2.0.

Change-Id: Iacbf13df35befebcc0a86784b380c2ac694516e8
2018-03-11 16:05:35 +01:00
Ian Y. Choi b0a8cb908f [trivial] fix typo
- Openstack -> OpenStack
  (found during translation in Hard StringFreeze period)

Change-Id: I983c424554659b07d5ea82937454901eb6fa86a2
2018-02-12 08:36:29 +00:00
Dao Cong Tien 1fd14f161a TrivialFix: remove redundant import alias
Change-Id: Ib027d5e467e05a683b2da2097a2c05d676115b67
2018-01-24 09:15:51 +07:00
qiaomin fcdc776981 Rename the 'SAHARA_AUTO_IP_ALLOCATION_ENABLED' config parameter
The 'SAHARA_AUTO_IP_ALLOCATION_ENABLED' config parameter in Sahara
is confusing. If you wish to disable floating IP options during node
group template creation, set it 'True', but this name sounds like it
has to do with automatically associating a floating IP. So this patch
renames it to a meaningful variable name.

Change-Id: If8f71ea21cb71bbffe996f7db88b7683ad91ecac
2018-01-16 13:39:18 +00:00
qiaomin 382c172976 Use 'trimmed' for blocktrans in multi-line strings
blocktrans trimmed option removes newlines from contents of blocktrans
and replaces any whitespace at the beginning and end of a line into
a single space. This makes translator life easier.

Closes-Bug: #1741761
Change-Id: I7e8d5337553fff595e66ea406f6528bb6b36ff94
2018-01-07 23:22:42 +08:00
Zuul 4be68b6d44 Merge "Add import of cluster templates to GUI." 2018-01-04 14:13:05 +00:00
Iwona Kotlarska ca05aed68c Add import of cluster templates to GUI.
Partially-Implements: bp portable-node-group-and-cluster-templates

This change adds button "Import Template"
to cluster templates tab in dashboard.

Change-Id: If83aaf34f84e82052c3a82ab36cb61648ff3125f
2017-12-29 10:09:13 -03:00
Zuul bd9df45a36 Merge "Add import of node group templates" 2017-11-15 10:48:33 +00:00
Iwona Kotlarska 314f4fda62 Add import of node group templates
Partially-Implements: bp portable-node-group-and-cluster-templates

This change adds Import Template button to Node Group Templates Tab.

Change-Id: I68c2fa2a856fa8e14aa9512b11f0ea326c25f2a5
2017-11-13 17:25:38 -03:00
Zuul f0fde9acb8 Merge "Add export of cluster templates to UI" 2017-11-06 22:42:28 +00:00
Jeremy Freudberg ffe4371710 Fix plugin version sorting
Default sorting is not good enough, since it alphabetically sorts
numbers, as in 11 < 2 instead of 11 > 10.

Change-Id: Iaa575cf4ba0fe76524ba2823ce50de30a5b931d9
Closes-Bug: #1707204
2017-10-05 13:04:54 -04:00
Iwona Kotlarska a1777e7658 Add export of cluster templates to UI
Partially-Implements: bp portable-node-group-and-cluster-templates

Depends-On: I027169ace70929318990a4225d456bf1cf8a83b2

This chande adds an option to GUI to enable user export a cluster template

Change-Id: If1c1b055c3f03b656853db1b35c42a422b08de7f
2017-08-29 20:00:18 +02:00
Iwona Kotlarska d6056d1ab6 Add export of node group templates
Partially-Implements: bp portable-node-group-and-cluster-templates

Depends-On: I33c3b6daa5b9e2be218a84efdb6113a4ce9a86df

This change adds functions to saharaclient to enable export of ngt
to JSON.

Change-Id: Ic5d9dffd0a3ae21a28ecbcfdd88f5cd1194551bb
2017-08-28 21:50:01 +02:00
Shu Yingya b624278524 Fix the compatibility after django 1.11 support
In patch[1], the change didn't completely fix the issue
that can't open NGT creating widget if django didn't upgrade
to the lastest version 1.11.
This patch fixes the issue by rewriting the method "build_attrs".

[1] https://review.openstack.org/#/c/489576/

Change-Id: I748c71fd26d3abaf4a059db3c2224589284131c6
2017-08-03 01:07:12 +08:00
Jenkins e73f9ec7c6 Merge "Fix can't open the NGT creating form" 2017-08-01 13:08:40 +00:00
Jenkins fe04928357 Merge "Check for volumev2 and volumev3 too" 2017-08-01 12:55:53 +00:00
Shu Yingya 309e1662fa Fix can't open the NGT creating form
Horizon team has overloaded a method "build_attrs" in [1]
to use "var-keyword parameter".
Sahara dashboard will face an error when click button to create
node group template. Error message is:
  "TypeError: build_attrs() got an unexpected keyword argument 'name'"

[1]: https://review.openstack.org/#/c/484277/

Change-Id: I4b4fc2d12465fcda5e0feddcf4aab6b11bd9be10
2017-08-01 19:58:45 +08:00
Luigi Toscano 8e77e74cc8 Switch render() arguments to the new way
The object returned by get_template() and select_template() is different
and its render() method has a different signature (no more Context or
RequestContext) after Django 1.8. The old way was removed in 1.11.

See also the relase notes for Django 1.8:
https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/#get-template-and-select-template

Inspired by https://review.openstack.org/#/c/475137/

Depends-On: I25e294a1c2f721a2f57dd50acb4c5e408b6187f9
Change-Id: I0f9af1f1d1a084b97a3809615a431a4f0bddf5d3
2017-07-31 16:51:03 +02:00
Jeremy Freudberg ed4cb76aa2 Check for volumev2 and volumev3 too
If we don't check for all three possible Cinder service types, we may
end up with Cinder options hidden even when the service is in fact
available.

Change-Id: Ic844dc7d3b138b0918f9c436f0550fe0a4379bae
Closes-Bug: #1678534
2017-07-18 10:02:27 -04:00
Jeremy Freudberg fce0b61b78 Make health check info hideable
If cluster verification in Sahara is totally disabled, then operators
probably do not want to have ugly UNKNOWN in the cluster status page.
They also probably do not want any references to health at all, if
there will never be any usable information there. So, let's add
something that can be read from local_settings to disable these when
the operator doesn't want them.

Change-Id: Ifc624d07767ed29646aa8a5b5739103fd4972b90
Co-Authored-By: Lucas H. Xu <xuh@bu.edu>
2017-06-06 15:21:59 +00:00
Jeremy Freudberg 1c7c9e9251 Fix neutron-related openstack_dashboard imports
Hot Fix: In [0], floating IP and security group operations within
openstack_dashboard were moved. The imports are now corrected.

[0] https://review.openstack.org/#/c/466645/

Related-Blueprint: bp sahara-remove-nova-network
Change-Id: I2c086613fff302e852a2dda51701c620371a27e4
2017-06-06 10:05:01 -04:00
Marianne Linhares Monteiro 1f3c44cb6d Adding missing translation blocks
Change-Id: I497b752d60a336592c3d12a70308ad80b696390e
Closes-bug: 1661501
2017-04-11 10:04:57 -03:00
Shu Yingya 0011eb6130 Fix bugs of redirect url
Horizon has some changes as bellow about security group and keypairs.
Sahara-dashboard should sync the location of resource with horizon.

* Move Security Groups into its own panel
	https://review.openstack.org/#/c/427882/
* Make Key Pairs tab a panel under Compute:
	 https://review.openstack.org/#/c/408247/

Change-Id: I705e2feff090acd1d17e58b3d77c185fd0006c19
2017-03-27 20:20:23 +08:00
kavithahr 89b43b3d0e Replaces uuid.uuid4 with uuidutils.generate_uuid()
Change-Id: I745bdf2db5821ee951021c39105be9439e6f8831
2017-03-11 11:03:11 +00:00
Rajiv Kumar 0d15f0ec52 Switch to oslo_log
Change-Id: I1fe00ab7b0405422af76488245a67b3d68e29f06
2017-01-18 16:49:30 +05:30
Shu Yingya 4e7680a3e3 Make plugin version orderly in version list
Just a minor chanage that sorted plugin version in the drop down list.

Change-Id: I2868fb1cdd4f71af48d5a41ed56a8dfa45e3b40a
2016-12-26 04:09:49 +00:00
Jenkins 4737e0f40b Merge "fix error redirecting of image-register" 2016-11-28 15:30:51 +00:00