Updates for py312 compatibility

- Added py312 section to tox.ini [testenv]
- Updated flake8 to 7.1.1 instead of 3.9.2
- Fixed pep8 errors
- Removed setuptools pin

Change-Id: I37e85e784e3cea71e3e12e3e353777f25f54a404
This commit is contained in:
Jadon Naas
2024-08-21 15:58:11 +00:00
parent 06da739829
commit a0f44b1cf6
5 changed files with 12 additions and 7 deletions

View File

@@ -260,8 +260,8 @@ def delete_node(node_name, failure_is_fatal=True):
def get_property_from_xml(name, output):
"""Read a configuration property from the XML generated by 'crm configure show
xml'
"""Read a configuration property from the XML generated by
'crm configure show xml'
:param name: property's name
:param output: string with the output of `crm configure show xml`

View File

@@ -1328,14 +1328,14 @@ def assess_status_helper():
corresponding messages
"""
if config('stonith_enabled') in ['true', 'True', True]:
return(
return (
'blocked',
'stonith_enabled config option is no longer supported')
if config('no_quorum_policy'):
if config('no_quorum_policy').lower() not in ['ignore', 'freeze',
'stop', 'suicide']:
return(
return (
'blocked',
'Invalid no_quorum_policy specified')

View File

@@ -9,7 +9,6 @@
#
pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here.
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
requests>=2.18.4

View File

@@ -78,6 +78,12 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py312]
basepython = python3.12
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py3]
basepython = python3
deps =
@@ -87,7 +93,7 @@ deps =
[testenv:pep8]
basepython = python3
deps =
flake8==3.9.2
flake8==7.1.1
git+https://github.com/juju/charm-tools.git
commands = flake8 {posargs} hooks unit_tests tests actions lib files
charm-proof

View File

@@ -1285,7 +1285,7 @@ class UtilsTestCase(unittest.TestCase):
self.assertTrue(
utils.is_update_ring_requested('random-uuid-generated')
)
self.assertEquals(
self.assertEqual(
hook_data.kv.get('corosync-update-uuid'),
'random-uuid-generated',
)