Update afsmon python testing to modern versions

We run this tool primarily on our mirror-update nodes which are
currently Focal with python3.8. We want to drop the python35 testing so
that we can clean up our Xenial test nodes. Update afsmon's testing to
more closely match the current production environment and potential
future environments while also dropping python35 on Xenial jobs.

Small changes are made to fix a string escapes warning and a use of mock
error when running flake8.

Change-Id: Id509936bf9eb200fc92dcaa06a18c1a79ef13e2c
This commit is contained in:
Clark Boylan 2024-04-29 11:39:40 -07:00
parent 0bbe8b439f
commit 4fd41a7033
4 changed files with 22 additions and 12 deletions

View File

@ -1,9 +1,19 @@
- project:
templates:
- openstack-python35-jobs
check:
jobs:
- openstack-tox-pep8
- tox-pep8
- tox-py38:
nodeset: ubuntu-focal
- tox-py310:
nodeset: ubuntu-jammy
- tox-py311:
nodeset: debian-bookworm
gate:
jobs:
- openstack-tox-pep8
- tox-pep8
- tox-py38:
nodeset: ubuntu-focal
- tox-py310:
nodeset: ubuntu-jammy
- tox-py311:
nodeset: debian-bookworm

View File

@ -81,7 +81,7 @@ class FileServerStats(object):
# Matching:
# mirror.yum-puppetlabs.readonly 536871036 RO 63026403 K On-line
vol_regex = re.compile(
'^(?P<vol>[^\s]+)\s+(?P<id>\d+)\s(?P<perms>R[OW]|BK)\s+(?P<used>\d+) K' # noqa: E501
r'^(?P<vol>[^\s]+)\s+(?P<id>\d+)\s(?P<perms>R[OW]|BK)\s+(?P<used>\d+) K' # noqa: E501
)
# Read the output into chunks where each chunk is the info for

View File

@ -11,8 +11,8 @@
# under the License.
import afsmon
import configparser
import mock
import os
import unittest.mock
from afsmon.cmd.main import AFSMonCmd
from afsmon.tests import base
@ -77,7 +77,7 @@ class TestPyAFSMon(base.TestCase):
'afs.afs01_dfw_openstack_org.vol.mirror_foo.creation',
value=str(d.strftime("%s")), kind='g')
@mock.patch('afsmon.subprocess.check_output', autospec=True)
@unittest.mock.patch('afsmon.subprocess.check_output', autospec=True)
def test_vos_listvol_parsing(self, mock_check_output):
with open(os.path.join(

View File

@ -5,17 +5,17 @@ description-file =
README.rst
author = Ian Wienand
author-email = ian@wienand.org
home-page = https://github.com/ianw/pyafsmon
home-page = https://opendev.org/opendev/afsmon
classifier =
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
[files]
packages =