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
The version currently used is too old.
Also fix E275 "missing whitespace after keyword" newly detected.
Change-Id: I37e88d6b6bd707e9cc626e3625b9c034c7b5c553
This updates the default policy file and sample policy file based
on the latest policy rules in heat code.
Change-Id: I1d9fca846a56ae4893d76053ee1f0b9b6434dbd8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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>
In Python3, assertRegexpMatches & assertNotRegexpMatches
are deprecated in favor of assertRegex and assertNotRegex
Change-Id: I770e45ea04b799fa102887275acc95cdddbfd162