Resolve the following deprecation warning:
DeprecationWarning: the load_module() method is deprecated and slated
for removal in Python 3.12; use exec_module() instead
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I403289d5df2143872503fc246a993cb19ebba68e
cloud-init was released on 2011-01-27. It may be reasonable to assume
that no one is using older versions.
Change-Id: I8f6d3ed0aadd00e76710308fec7d3a1b1d5bb0e9
The zoneinfo module was introduced in Python 3.9. We can use that
built-in module instead of the 3rd party library (pytz).
This is based on change I1f88bdadc68bfa726eac1da1c5824c1ed352ad98 in
oslo.utils.
Change-Id: I539120a6bfb850b0c4e384e51caa021761a4f6b8
This commit adds the configuration options related to resource limits
in the Heat project. The `max_software_configs_per_tenant`,
`max_software_deployments_per_tenant`, and `max_snapshots_per_stack`
options have been added to control the maximum limits for software
configs, software deployments, stack snapshots.
Story: 2011006
Task: 49401
Change-Id: If33a1c6f3eb9e93f586931bc5c05104439c92bf9
Snapshot.get_all does not return all snapshots of the project but
returns all snapshots associated with a single stack, so its name
should contain _by_stack for consistency.
Change-Id: Ic6b93b7cfc84793077672b3f1052f03519e4c5a1
Objects used only within the single test does not need to be part of
the TestCase instance of that test.
Change-Id: I05c0877315e6e4897e8b097d5df3e81b60022870
has_calls is not the correct method for asserting a list of calls
has occured during testing. Use assert_has_calls instead.
This also revealed an issue in the expected signature for one
of the mock calls in the test_software_config module.
Change-Id: Ib01ee79f49525f6d0ba7915108ef92c338a8f393
Monasca, Sahara and Senlin were marked inactive during this cycle and
will not be part of the 2024.1 release. Because these projects are not
maintained in a consistent way, we deprecate resources for these
services.
We aim to remove these in the 2024.2 release.
Change-Id: Iab377ebc2569a4a5a81f736a1dfe9f406135f5d3
The wrappertask decorator was deprecated some cycles ago[1]. This is
internal implementation so could be even removed directly.
[1] 2c58017a14
Change-Id: I0f2e25971201e2a01b3e86bd859e8a4bdb98d371
LBaaS v2 was retired a while ago and now the related resources are all
hidden. Thus we can remove all implementation to reduce dependency on
python-neutronclient which is deprecated.
Story: 2010678
Task: 47761
Change-Id: I4de6cb353bc3699d124ea55666c87e4efd7e4350
This resource requires Glance v1 API which was already removed[1][2].
It was deprecated some time ago so we can hide it now.
[1] 3dde3204d5c1b5323dba2d7b7607e69bcc58bbb2
[2] 30680961994b36ed12713c0f106b661535ce41c6
Change-Id: Ifbefdbc032c0b1ac538d68b41f13d0547b793ba5
The loadbalancer property of Octavia::Listener resource has been
optional but this is not aligned with Octavia's API and causes
a strange failure when a user creates a pool without the property.
This makes the property required to enforce the same requirements as
one made by Octavia's API.
Story: 1748389
Task: 17347
Change-Id: Ib8af29c3d45d5ffbbb21c216429ef38d0d273d05
Based on the agreed steps to implement the SRBAC community goal, this
enables the new policy defaults and scope checks by default.
Change-Id: I315893150549d1174c3270c37c031e6a519f9a28
Resolve the following deprecation warning:
DeprecationWarning: find_module() is deprecated and slated for
removal in Python 3.12; use find_spec() instead
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I88005c694b94d249bce53f46df67b51c7e01adae
SQLAlchemy 2.0 wraps mostly everything in transactions, which limits our
ability to do this easily on a non-global basis. Use the raw connection
[1] instead.
[1] https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.execute
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ic2bbf59550e965769c6b64f3e5eeec9783c6b290
We were previously calling 'connect()' on the 'connectable' object in
'run_migrations_online', regardless of whether it was an 'Engine' or
'Connection' object. This worked because, as noted in an inline comment,
"when connectable is already a Connection object, calling 'connect()'
gives us a *branched connection*." This is no longer the case. From the
SQLAlchemy docs [1]:
The Connection object does not support "branching", which was a
pattern by which a sub "connection" would be used that refers to this
connection as a parent.
Update our code to reflect this change, using the newly updated example
from the SQLAlchemy cookbook doc [2] as inspiration.
[1] https://docs.sqlalchemy.org/en/14/core/future.html#sqlalchemy.future.Connection
[2] https://alembic.sqlalchemy.org/en/latest/cookbook.html#connection-sharing
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Id41ae6d3fa3f343efdb727aae9bdef8ad2a098fd
This also gets us away from autocommit, i.e. the last outstanding item
in our preparation for SQLAlchemy 2.x.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I95c5e5d6b33e73a1df2bf036df44aa2e06cc9640
Make sure we avoid nested sessions going forward.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ia171bb823f5302fb3a6b2f6f88f7295f97254759
Well, we actually remove it but keep the entry point to avoid breaking
scripts. This has been around since 2016 and anyone that hasn't upgraded
now ain't upgrading.
This is one less set of APIs to worry about when removing the use of
autocommit.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I43051b3ca6e292f1164d750b04d7a440012b2ef5
This turned out to be easier done that I expected.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ie50b4bd212c758ec41c82be145290024910099a0
This patch adds support for Aodh alarms of type Prometheus.
Depends-On: I72e124cca4398b78f7ed12e1db3f66bdbfcb196e
Change-Id: I5bb7c4d9086715fc22c0f7abc36d9bbfc88a60c9
Some tests were failing if run by themselves.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ic797e8648283605940be9d0889c38641f34e86e7
Software deployments have FK constraints on software configs.
This change ensures the DBReferenceError caused by the constraints is
properly caught. With this change now heat returns 400 Bad Response,
instead of 500 Internal Server Error when a user tries to create
a software deployment with a non-existing software config.
Also, the stack_user_project_id field is defined as 64-chars-long
string in DB model, so we should ensure that the input value is shorter
than 65 chars. Otherwise it also results in DB error.
Story: 2010001
Task: 45098
Change-Id: I03274dc0cffa226140eb720458cce81e8b5ce187
This change updates the default policies implemented in Heat, to follow
the updated guideline[1] to implement SRBAC.
The main change is that system users are no longer allowed to perform
any operations about project-level resources like stacks, while project
admin(*1) is still allowed to perform operations about project-level
resources BEYOND project (like getting stacks for all projects by list
stacks API).
[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#direction-change
This also adds the test cases to validate reader role which was almost
implemented in heat.
(*1)
If Keystone has an admin project defined, Heat checks an additional
requirement that request context is scoped by that admin project.
Change-Id: I943b3c1ce021cc05445b73fbc342b8386cf5bf6a
Resolve the following RemovedIn20Warning warning:
The current statement is being autocommitted using implicit
autocommit, which will be removed in SQLAlchemy 2.0. Use the .begin()
method of Engine or Connection in order to use an explicit transaction
for DML and DDL statements.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ibe7503002be9f7cdf13259379ebbf6e9c329a028
Resolve the following RemovedIn20Warning warnings:
Using strings to indicate column or relationship paths in loader
options is deprecated and will be removed in SQLAlchemy 2.0. Please
use the class-bound attribute directly.
Using strings to indicate relationship names in Query.join() is
deprecated and will be removed in SQLAlchemy 2.0. Please use the
class-bound attribute directly.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I81a506281a0cece77cad41c5290e41fa3d7ef246
Resolve the following RemovedIn20Warning warnings:
The MetaData.bind argument is deprecated and will be removed in
SQLAlchemy 2.0.
The ``bind`` argument for schema methods that invoke SQL against an
engine or connection will be required in SQLAlchemy 2.0.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Idcd26c539f6c46dac245e6a445e64a0bf1596379
Resolve the following sqlalchemy.exc.RemovedIn20Warning warning:
The legacy calling style of select() is deprecated and will be removed
in SQLAlchemy 2.0. Please use the new calling style described at
select().
For more information, refer to http://sqlalche.me/e/b8d9.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Id64999a7aa6081a5b1f2ac12674204bd02f2c012
Resolve the following RemovedIn20Warning warnings:
The autoload parameter is deprecated and will be removed in version
2.0. Please use the autoload_with parameter, passing an engine or
connection.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I2a626bd60ecc824d9328d08e582d78d5cb568f5a
Actually, not really. We just remove the warning. Apparently it's not
used here.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ie6c45772247850d40b0cf4b135e5a3028b1758af
Resolve the following RemovedIn20Warning warning:
The Engine.execute() method is considered legacy as of the 1.x
series of SQLAlchemy and will be removed in 2.0.
This one is pretty simple.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Iec56e6bff476ae9b68a4821be9cc93e3af84a325