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
ABCs in collections should be imported from collections.abc and direct
import from collections is deprecated since Python 3.3.
Change-Id: Ifb983fa478120a95760bf0cb78994210acdbe8e8
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
In this commit [0] has monkey patching should be as
early as possible, but didn't monkey patch murano api,
this will cause the RecursionError
[0]: I76fed9e80a7f848a0f6b37c25dd035844c75a6ee
Change-Id: Idf8ab02b15459d4dc786389c583afb752c599cb6
Closes-Bug: #1886784
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
Currently getting the following error:
TypeError: You cannot set Response.body to a text object (use Response.text)
Closes-Bug: #1882156
Change-Id: Iba918ec671dabb2d0df72e071c6279176c63b312
This ensures that options loaded during any prior run of the
application are dropped before being added again during init_application.
Change-Id: I16b17b7b93bed698495582c972870b3d8e3c926b
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
https://github.com/eventlet/eventlet/issues/592
Also disable E402 to allow the change in.
Change-Id: I508fcd0707ecdd2bf720303f6cbb4087a38aaadd
Closes-Bug: #1863021
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>
We were seeing infinite recursion opening an ssl socket when running
various combinations of python3, eventlet, and urllib3. It is not
clear exactly what combination of versions are affected, but for
background there is an example of this issue documented here:
https://github.com/eventlet/eventlet/issues/371
(Commit message copied in part from nova commit
3c5e2b0e9fac985294a949852bb8c83d4ed77e04)
Change-Id: I76fed9e80a7f848a0f6b37c25dd035844c75a6ee