Skip to content

Commit

Permalink
Updates for py312 compatibility
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
jadonn committed Aug 21, 2024
1 parent 06da739 commit a0f44b1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions hooks/pcmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/test_hacluster_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ def test_is_update_ring_requested(self, HookData):
self.assertTrue(
utils.is_update_ring_requested('random-uuid-generated')
)
self.assertEquals(
self.assertEqual(
hook_data.kv.get('corosync-update-uuid'),
'random-uuid-generated',
)
Expand Down

0 comments on commit a0f44b1

Please sign in to comment.