File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1080,6 +1080,17 @@ def validate_weigher(weigher):
1080
1080
_SUPPORTS_SOFT_ANTI_AFFINITY = None
1081
1081
1082
1082
1083
+ def reset_globals ():
1084
+ global _SUPPORTS_AFFINITY
1085
+ _SUPPORTS_AFFINITY = None
1086
+ global _SUPPORTS_ANTI_AFFINITY
1087
+ _SUPPORTS_ANTI_AFFINITY = None
1088
+ global _SUPPORTS_SOFT_AFFINITY
1089
+ _SUPPORTS_SOFT_AFFINITY = None
1090
+ global _SUPPORTS_SOFT_ANTI_AFFINITY
1091
+ _SUPPORTS_SOFT_ANTI_AFFINITY = None
1092
+
1093
+
1083
1094
def _get_group_details (context , instance_uuid , user_group_hosts = None ):
1084
1095
"""Provide group_hosts and group_policies sets related to instances if
1085
1096
those instances are belonging to a group and if corresponding filters are
Original file line number Diff line number Diff line change 62
62
from nova .objects import base as objects_base
63
63
from nova import quota
64
64
from nova .scheduler .client import report
65
+ from nova .scheduler import utils as scheduler_utils
65
66
from nova .tests import fixtures as nova_fixtures
66
67
from nova .tests .unit import matchers
67
68
from nova import utils
@@ -310,6 +311,12 @@ def setUp(self):
310
311
if self .STUB_COMPUTE_ID :
311
312
self .useFixture (nova_fixtures .ComputeNodeIdFixture ())
312
313
314
+ # Reset globals indicating affinity filter support. Some tests may set
315
+ # self.flags(enabled_filters=...) which could make the affinity filter
316
+ # support globals get set to a non-default configuration which affects
317
+ # all other tests.
318
+ scheduler_utils .reset_globals ()
319
+
313
320
def _setup_cells (self ):
314
321
"""Setup a normal cellsv2 environment.
315
322
You can’t perform that action at this time.
0 commit comments