Skip to content

Commit

Permalink
Merge pull request ceph#49490 from tchaikov/wip-pybind-mgr-tox-fixes
Browse files Browse the repository at this point in the history
pybind/mgr: tox and test fixes

Reviewed-by: Matan Breizman <[email protected]>
  • Loading branch information
tchaikov authored Dec 19, 2022
2 parents 1c8cde7 + 0cc649f commit 4ffa58c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, pool_count, pg_target, pg_left):

class TestPgAutoscaler(object):

def setup(self):
def setup_method(self):
# a bunch of attributes for testing.
self.autoscaler = module.PgAutoscaler('module_name', 0, 0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_osds_under(self, root_id):

class TestPgAutoscaler(object):

def setup(self):
def setup_method(self):
# a bunch of attributes for testing.
self.autoscaler = module.PgAutoscaler('module_name', 0, 0)

Expand Down
4 changes: 2 additions & 2 deletions src/pybind/mgr/progress/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class TestPgRecoveryEvent(object):
# Testing PgRecoveryEvent class

def setup(self):
def setup_method(self):
# Creating the class and Mocking
# a bunch of attributes for testing
module._module = mock.Mock() # just so Event._refresh() works
Expand Down Expand Up @@ -90,7 +90,7 @@ def pg_to_up_acting_osds(self, pool_id, ps):
class TestModule(object):
# Testing Module Class

def setup(self):
def setup_method(self):
# Creating the class and Mocking a
# bunch of attributes for testing

Expand Down
6 changes: 3 additions & 3 deletions src/pybind/mgr/prometheus/module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cherrypy
from collections import defaultdict
from distutils.version import StrictVersion
from packaging.version import Version
import json
import math
import os
Expand Down Expand Up @@ -32,10 +32,10 @@
# ipv6 isn't yet configured / supported and CherryPy throws an uncaught
# exception.
if cherrypy is not None:
v = StrictVersion(cherrypy.__version__)
v = Version(cherrypy.__version__)
# the issue was fixed in 3.2.3. it's present in 3.2.2 (current version on
# centos:7) and back to at least 3.0.0.
if StrictVersion("3.1.2") <= v < StrictVersion("3.2.3"):
if Version("3.1.2") <= v < Version("3.2.3"):
# https://github.com/cherrypy/cherrypy/issues/1100
from cherrypy.process import servers
servers.wait_for_occupied_port = lambda host, port: None
Expand Down
28 changes: 14 additions & 14 deletions src/pybind/mgr/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,20 @@ deps =
flake8
allowlist_externals = bash
modules =
alerts
balancer
cephadm
cli_api
crash
devicehealth
diskprediction_local
hello
iostat
localpool
nfs
orchestrator
prometheus
rbd_support
alerts \
balancer \
cephadm \
cli_api \
crash \
devicehealth \
diskprediction_local \
hello \
iostat \
localpool \
nfs \
orchestrator \
prometheus \
rbd_support \
selftest
commands =
flake8 --config=tox.ini {posargs} \
Expand Down

0 comments on commit 4ffa58c

Please sign in to comment.