Due to slight differences in the --help output text for the test
runner, the output comparison no longer matches once you get past
python 3.8.
This fix cleans up the help text itself, and modifies the test to
only match on some specific elements, not the whole thing.
This should make the test less fragile going forward.
Change-Id: I7b94d8ae9eb58c43676ae3171c0f6193496c6d4b
Since testing with Python 3.10, the test
murano.tests.unit.dsl.test_helpers.TestDSLHelpers.test_weak_ref
was failing with
testtools.matchers._impl.MismatchError: 'weakref' != 'ReferenceType'
This is simply the result of newer Python being more correct about
the name of the weakref ReferenceType.
The fix here is to ask what the name is of the class and use that
instead of the hardcoded 'weakref' name.
Change-Id: I26ea4750f10dedb04a07d188e57fcd391a28f870
The various test cases and mixins in 'oslo_db.sqlalchemy.test_base' have
been deprecated since oslo.db 4.34.0 (March 2018). Remove use of these.
Change-Id: Ic4ba41e61de3a33d6779b53bb0274e5e115e335a
As of the oslo.context 4.0.0 release, RequestContext objects no
longer have a tenant attribute, instead expecting callers to use
project_id for that purpose. Update all context.tenant references to
context.project_id in order to facilitate this transition.
Change-Id: I2830ccf840bf4d1d8a516287adee51c46d2a5583
This reverts commit 4fbe4ee433.
Reason for revert:
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.
[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b
Change-Id: Ic35ab4936d82e07493ecd5f81e6e46a84dc6546c
This change mocks sqlalchemy.update during unit tests properly to avoid
the following error.
sqlalchemy.exc.ArgumentError: subject table for an INSERT, UPDATE or
DELETE expected, got <MagicMock name='models.Instance' id='...'>
Closes-Bug: #1938676
Change-Id: I5268132018e0a283bd35b5599cf8ca41968dde93
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:
1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.
2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.
Also replace policy.json to policy.yaml ref from doc and tests.
CONF object needs to be initialized before policy enforcer(). That
need to remove cfg.CONF.unregister_opts from TestAuthUtils cleanup
as this is taken care by cfg.clear() with proper workflow otherwise
it end up with error
"oslo_config.cfg.ArgsAlreadyParsedError: arguments
already parsed: reset before unregistering options"
- https://b132754ee7062a9ab187-9add4719a9922a9385555a8552fc2366.ssl.cf5.rackcdn.com/768520/5/check/openstack-tox-py38/7964354/testr_results.html
[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html
Change-Id: I1b6c6485bc651fd0b87244a68204036dd4aa37f4
This patch introduces a common rpc pattern to ensure
that the rpc transport is shared where possible. This
helps prevent rpc connection leaks and should ensure
that we are making the best possible use of all
available rpc connections.
Change-Id: Ib42e368cfda2b148a07df0bd74046739f40f7018
This error was appearing when calling some murano methods through
YAQL functions.
The helpers.function() call was testing for im_func which was
deprecated on Python 3.
Switching to __func__ is the correct way to get the function from
a method.
Change-Id: I473283e0d5a4901ff787f434a5f5f9d923090614
As per victoria cycle testing runtime and community goal,
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).
Bump lower constraints to make testing work for Focal.
Change-Id: I1fc6b0c67d767bc698e12f0e79fadd19bb7d0a8d
Story: #2007865
Task: #402198
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual
We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: Ida67a22b153175b8517782593718b7c60f633c16
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: Id266a937b37507a1cef05ac34e33a80265581ad1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
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.
Change-Id: Ibe28b6b6bf3927e80816f0c5f1cb972fb6e2374b
unittest2 was needed for Python versions <= 2.6, so it has not been
needed for quite some time now. See unittest2 note on:
https://docs.python.org/2.7/library/unittest.html
This drops unittest2 in favor of the standard unittest package.
Change-Id: Idb4cb10509f49afe86bfdb688e35a7822dfe38bd
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Now use admin client to delete the trust gives the error:
"You are not authorized to perform the requested action:
Only admin or trustor can delete a trust.: ForbiddenAction:
You are not authorized to perform the requested action:
Only admin or trustor can delete a trust."
This patch use trustor's session to delete the trust.
Change-Id: Ib673128be860f548195181a465a9dff784cdef1a
This commit adds the functionality of murano-status CLI for performing
upgrade checks as part of the Stein cycle upgrade-checkers goal.
It only includes a sample check which must be replaced by real checks in
future.
Change-Id: If7987cdf5d9a686abbcad5960b8f391f8b9518a3
Story: 2003657
Task: 26143
Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.
[1]: https://review.openstack.org/#/c/508522/
Change-Id: Ib8623a359a27b8a4aa90bf69a3fe3f3a5c2411a6
New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Heat delegates making this call
to oslo.service, so how do we switch?
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e allows services to tell
oslo.service they want mutate_config_files to be called by passing a
parameter, which this patch does.
This allows Murano to benefit from
I1e7a69de169cc85f4c09954b2f46ce2da7106d90, where the 'debug' option
(owned by oslo.log) is made mutable. We should be able to turn debug
logging on and off by changing the config and sending SIGHUP.
Change-Id: Ia7e405392fe67eb9c4abf2408db0fa25c5546958
Story: 2001545
This reverts commit 51818f07d1 and forward
ports the testing change from stable pike:
In murano allowed_pattern set as:
allowed_pattern: [A-Za-z0-9]
But in hot example is set as:
allowed_pattern: '[a-zA-Z0-9]*'
So change the test template allowed_pattern.
Change-Id: I89ac4ef9de5eb0a5176c9df2ce1f289ca0d2cc65
(cherry picked from commit a682d5ee92)