Commit Graph

141 Commits

Author SHA1 Message Date
Pavlo Shchelokovskyy d3f61d5618 Fix template generated by Template Generator
do not stringify get_resource and get_attr, these must continue
to be objects so that they are correctly rendered to YAML.

As a result, `get_resource_string` was removed as no longer used.

Change-Id: I621c55dd9a0c59f7eb8a87ef1f85557bd38b05d1
Story: 2005120
Task: 29769
2024-02-15 00:52:53 +02:00
Zuul 9d4aa416df Merge "Changes the data field used to populate the E.N. select" 2024-02-14 16:21:22 +00:00
Takashi Kajinami dd046e42f8 Bump hacking
The version currently used is too old.

Also fix E275 "missing whitespace after keyword" newly detected.

Change-Id: I37e88d6b6bd707e9cc626e3625b9c034c7b5c553
2024-01-17 01:22:22 +09:00
Takashi Kajinami 85273d0694 Regenerate policy files
This updates the default policy file and sample policy file based
on the latest policy rules in heat code.

Change-Id: I1d9fca846a56ae4893d76053ee1f0b9b6434dbd8
2023-09-23 23:45:15 +09:00
Zuul 36078b7fbc Merge "Fix 500 error when fetch data about deleted stack" 2023-09-12 12:10:25 +00:00
Zuul 9f0b334888 Merge "remove unicode prefix from code" 2023-08-29 19:03:44 +00:00
Vadym Markov b7f3dcc774 Fix 500 error when fetch data about deleted stack
Currnetly, request of dashboard to Horizon API works only for existing
stack. Request about deleted stack fails with 500 status. Proposed patch
fixes it

Story: 2009731
Task: 44148
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ia6ef4459ab8c4c8f3f08e7c655c894cb152238da
2023-06-15 20:06:30 +00:00
Zuul ecd4f03a02 Merge "Deal with bytestring serialized json" 2023-05-23 12:46:42 +00:00
niuke 0525d54cca remove unicode prefix from code
Change-Id: I2bb0aa3a7d285bade0fdf115f4afa2e37e9f9c4b
2022-08-29 08:42:29 +08:00
Corey Bryant f5f2c89f4a Django 4.x: urlunquote() is removed in 4.0
https: //docs.djangoproject.com/en/4.0/releases/4.0/
Change-Id: I23c767d25fa9585ff322e628714a30f966974fd8
2022-07-21 15:48:18 +09:00
Zuul 2cb96202d0 Merge "Replace deprecated ugettext_lazy and ungettext_lazy" 2022-05-24 09:20:50 +00:00
Zuul 3597bd7412 Merge "Set False to include_empty_option" 2022-05-24 06:19:58 +00:00
Takashi Kajinami 1ea4f6d15d Replace deprecated django.conf.urls.url()
This method is deprecated in Django 3.1[1], in favor of
django.urls.re_path(), and triggers the following warning.

RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor
of django.urls.re_path().

This was already fixed in Horizon by [2].

[1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2
[2] d9266fd82c1f0acc6b7236a6dc9b7e510985eb13

Change-Id: Ib921e98f220efb697e42673ca43da36cc151e7c7
2022-05-24 05:12:19 +00:00
Takashi Kajinami e976bf9765 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: Iee48af32956787cb4e16601fea34570f63df511c
2022-05-24 05:11:41 +00:00
manchandavishal 68f5d8c494 Fixed Unit test for Heat-dashboard
After 7052b7f065 merged in openstack/horizon a new Unit
test class introduced in horizon i.e. RestAPITestCase.
This patch updates heat-dashboard to import RestAPITestCase
class instead of TestCase. For more info. see [1]

It also update few packages version in lower-constraints.txt and
other files to fix lower-constraints job.

[1] https://review.opendev.org/c/openstack/horizon/+/827097/2/openstack_dashboard/test/helpers.py#485

NOTE: py36 support has been dropped for Zed, so py36 UT no longer works
with upper-constraints for Zed. Thus, the zuul job template is updated
for Zed in this commit together. This commit also needs to be backported
to stable/yoga to fix the UT. When backported, make sure not to include
the zuul template change for Zed.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I81241b2225f1e8b7b38f8f03928d5b4c0b4c8094
2022-05-24 00:42:38 +09:00
Akihiro Motoki 7729b75760 Fix UT failure due to horizon system-scope support
When horizon introduced the system-scope support in [1],
the way to mock User object in the helper class was changed a bit.
It now requires to setup User._is_system_user attribute properly.
This commit mirrors such change in openstack_dashboard/test/helpers.

[1] https://review.opendev.org/c/openstack/horizon/+/816368

Change-Id: I84c30705f6d2371c1bd74ba1ade4be4543ccf650
2022-02-16 18:48:51 +09:00
David Hill 64aeebd1ac Deal with bytestring serialized json
It looks like we're receiving an serialized json instead of a dict
from heat client when the template has a load from file

Change-Id: Ifa1c63b5feddff01f43a4689e6f12ade7e62d3c1
2022-02-10 17:01:46 +01:00
OpenStack Proposal Bot 458e9b0519 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I013c0dd3fb090c41288dfb5643d386c88bec0b1c
2021-10-28 03:04:50 +00:00
Thomas Goirand e085f1335e Fixed getting the location header
The old response._headers.get() doesn't work anymore with newer Django.
This patch fixes it.

Change-Id: I8c87804feef9909cd4697f01ceea0f5504347727
2021-09-21 14:46:17 +02:00
Takashi Kajinami 1f52db08ed Use volume v3 API instead of v2 API
The volume v3 API was deprecated during Pike cycle and is being removed
in Xena cycle.

Change-Id: I848d7dd868309a87efd432c8d458abf10c8794ae
2021-07-28 17:30:33 +09:00
Keigo Noha 792f8cbe4a Set False to include_empty_option
In _populate_custom_choices(), all methods called at the method have
True as a second argument. It means that the default values sepcified
in a stack are not shown as default when launch stack form.
The fileds always show 'Select Flavor/Image/Network'.
Users doesn't expect to choose default value by hand.
This change shows the default values defined at a template.

Also, image_field_data() doesn't use parameter, include_empty_option.
This change modfies the method to change the behavior based on the
parameter.

Closes-Bug: #1619465
Change-Id: I4b6bef322a668a805abcd4bc472d30f6d1df3a0a
2021-04-15 12:03:52 +09:00
Takashi Kajinami 8e7914fce2 Support policy-in-code and deprecated policy
This change adds support for policy-in-code and deprecated policy
following the change in horizon.

Depends-on: https://review.opendev.org/750134
Change-Id: I0e53dfd653213a78ccca8a20f4e909b5ed798641
2021-03-18 23:01:14 +09:00
OpenStack Proposal Bot 15b787ec6a Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Idc5ac8abf4dbcff02ea8bf3f9d3ece653b0b33e2
2021-03-03 06:44:30 +00:00
OpenStack Proposal Bot a36e451c17 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I1f1758ffa14ca9fc8048ff539bfeea57cfaf70e7
2020-10-05 06:28:46 +00:00
Pavlo Shchelokovskyy 953369c870 Move image_field_data method in-tree
this was removed in Horizon as 'not needed' in
26eebd4abbbabc1475bae61c51d1cfcf14dba770
however it is used to form a hint for glance.image constraint
in heat-dashboard.

Just copy-paste the method as it existed in horizon with minimal
adaptations.

Change-Id: I23fd3f45f0ce5b67691991336e727c377ca36281
2020-09-02 20:01:21 +03:00
Akihiro Motoki bd68639408 Use unittest.mock instead of third party mock
horizon recently switched from the third-party mock to unittest.mock.
This breaks heat-dashboard unit tests somehow.
We no longer support py27 and we can use the standard library
unittest.mock module. Rather than investigating the cause of
the failure, it would be nice to switch to unittest.mock.

horizon dependency is updated to 18.3.1 as unittest.mock is used
since 18.3.0 and 18.3.0 has an issue that it always requires pytest.
lower-constraints is updated to match horizon requirements.

hacking local-check-factory is disabled temporarily due to
the incompatibility with hacking 2.0 or later.
https://review.opendev.org/#/c/715690/ will recover it.

Change-Id: I517d6d7d36410c64bf48ad958b3e2115725a6491
2020-04-21 04:56:58 +09:00
Zuul 7842190851 Merge "Remove six usage (2/2)" 2020-01-22 06:20:52 +00:00
Zuul 1f11948091 Merge "Remove six usage (1/2)" 2020-01-20 18:15:19 +00:00
Andreas Jaeger 30c4992796 s/assertItemsEqual/assertCountEqual/g
assertItemsEqual was renamed to assertCountEqual in Python 3, and the
testsuite is failing now - rename it.
See also https://six.readthedocs.io/#six.assertCountEqual

This unbreaks the testsuite.

Change-Id: I95c81cfd6ab9bc7384c585ef5aa625dad9a57caf
2020-01-20 16:51:50 +01:00
Andreas Jaeger 79ef24a784 Remove six usage (2/2)
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.

This changes urllib usage.

mock.patch usage in heat_dashboard/test/tests/api/test_heat.py
is modified to cope with the mix usage of urllib from python3 (in
heat-dashboard) and six.moves.urllib (in heatclient).
In the case of the mix usage, patching urllib.request.urlopen() only
does not work as urllib.request.urlopen() is not called after
resolving a lazy loading in six and the resolved object is
six.moves.urllib.request is called. The previous code depends on
the behavior in heatclient read_url_content() and the method should
be mocked instead. Considering this, mocking in api/test_heat.py
is modified to mock direct methods called in the heat-dashboard code.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Icf3f889770242b02023fe22c405cfa2d823581a5
Needed-By: https://review.opendev.org/701743
2020-01-11 22:06:54 +01:00
Andreas Jaeger 7103caa069 Remove six usage (1/2)
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.

This changes everything besides urllib.

Change-Id: I43f76bc07d846341c1f5da69614e2be51ee05e30
Needed-By: https://review.opendev.org/701743
2020-01-11 20:54:19 +01:00
manchandavishal a0975b6198 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 also fixes failed test cases for django2.2 support.
For information please refer [1]

[1] https://review.opendev.org/#/c/681969/

Change-Id: I3ab81402633b9abe39e49c3921585db992050540
2019-10-30 17:19:18 +09:00
Zuul de7f249adb Merge "Enforces unicode decoding of data" 2019-09-02 11:12:19 +00:00
mareklycka 837a40e3b7 Enforces unicode decoding of data
The underlying APIs changed between Python2 and Python3, where
once they returned a string, they now return bytes. This change
enforces the decoding of the returned value as a UTF-8. Failure
to decode is handled by the existing exception handling.

Tests were updated to mimic the new API.

Change-Id: I98b474840a163f60e98aed0f75bc6b9df2a9aa00
Story: 2003343
Task: 24381
2019-08-06 12:50:34 +00:00
mareklycka 6a6aef59eb Changes the data field used to populate the E.N. select
Networks are split into two lists (floating_networks and networks)
server side based on the value of the "router:external" field. This
patch switches which group is used to populate the External Network
select to the one actually housing external networks.

Change-Id: I3c9b6e806a5a219fbd6580e5d8a201b8bdf10913
Story: 2005084
Task: 29668
2019-08-06 12:50:25 +00:00
OpenStack Proposal Bot 06e39a1b26 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I1ed230aa424a6f18d8b92440617447e038d546e7
2019-08-06 10:46:41 +00:00
OpenStack Proposal Bot a6eb65c0af Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I2872f47331515618c34d1511581ab8280dbde78d
2019-08-05 09:16:06 +00:00
OpenStack Proposal Bot 38d72bed17 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I7649507f24214d3607fb928722eb59d61854e1de
2019-08-03 08:41:11 +00:00
OpenStack Proposal Bot 60fb62f17a Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: If9e78c53e80a6a104f54400ea5044d7e92cf2e45
2019-06-18 07:14:15 +00:00
OpenStack Proposal Bot 78495ee8a3 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I30d397059390e57865a3dbfb62354d61dffcb52d
2019-05-06 07:46:57 +00:00
jacky06 25415b0e46 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I45befc03377d96c27db8b1d8d78dd7b5bec5ec14
2019-03-27 14:00:03 +08:00
OpenStack Proposal Bot 4c3e4da63b Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ib24a31e59ad4a404416c798a46033b93a9c88b56
2019-03-20 06:08:00 +00:00
Ivan Kolodyazhny e4a8ab4a11 Add heat-dashboard integration tests
This patch adds basic tests to verify that heat-dashboard is
installed and could be opened.

heat-dashboard-integration-tests job is added in a
non-voting mode.

Depends-On: https://review.openstack.org/634712
Change-Id: I2550d6fcd1ce4e05502f247e227aaec05e762fcb
2019-02-05 09:40:06 +02:00
manchandavishal d17cae6e77 Fix gate failures by a new pycodestyle
pycodestyle 2.5.0 introduces E117 over-indented.
This commit fixes E117 errors.

Change-Id: I1e8fdfa95753bc144a987f989f93e75e95d94a30
2019-01-30 17:51:33 +05:30
OpenStack Proposal Bot 840f572ef0 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I0f669b2a9695e1054bcf5712407750522875fe1d
2018-10-03 07:29:56 +00:00
Chuck Short fbbd58a459 Remove mox3 completely
The porting of mock is complete. This fullfills the
community goal
200~"Remove Use of mox/mox3 for Testing" set for Rocky:
https://governance.openstack.org/tc/goals/rocky/mox_removal.html

This commit does the following code:
- Remove dead code that was previously used by mox.
- Raise the requirement to the Rocky M2 relase of Horizon.
- Convert the clients to use mock.

Change-Id: I33521b4bc8e873d50b1d2390e544eea0923dca4f
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-28 05:30:01 +00:00
OpenStack Proposal Bot e4180839a4 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Icf6644d1203680f0e4154af8d9ed0e794d75ed25
2018-08-14 06:23:41 +00:00
Zuul d3199d5bf8 Merge "Add support of event list pagination" 2018-08-13 23:55:10 +00:00
Zuul 25d10dd303 Merge "Group resource icons by project" 2018-08-13 23:52:22 +00:00
wangqi df56338490 Use assertRegex instead of assertRegexpMatches
In Python3, assertRegexpMatches & assertNotRegexpMatches
are deprecated in favor of assertRegex and assertNotRegex

Change-Id: I770e45ea04b799fa102887275acc95cdddbfd162
2018-08-03 01:01:35 +00:00