Merge "Enable mypy on scheduler/report.py"

This commit is contained in:
Zuul 2021-04-21 17:23:33 +00:00 committed by Gerrit Code Review
commit 4b8005d10e
2 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ nova/compute/manager.py
nova/crypto.py
nova/network/neutron.py
nova/privsep/path.py
nova/scheduler/client/report.py
nova/scheduler/request_filter.py
nova/scheduler/utils.py
nova/virt/driver.py

View File

@ -181,9 +181,9 @@ class SchedulerReportClient(object):
self._adapter = adapter
# An object that contains a nova-compute-side cache of resource
# provider and inventory information
self._provider_tree = None
self._provider_tree: provider_tree.ProviderTree = None
# Track the last time we updated providers' aggregates and traits
self._association_refresh_time = None
self._association_refresh_time: ty.Dict[str, float] = {}
self._client = self._create_client()
# NOTE(danms): Keep track of how naggy we've been
self._warn_count = 0
@ -2452,7 +2452,7 @@ class SchedulerReportClient(object):
pcpus = usages['usages'].get(orc.PCPU, 0)
return vcpus + pcpus
total_counts = {'project': {}}
total_counts: ty.Dict[str, ty.Dict[str, int]] = {'project': {}}
# First query counts across all users of a project
LOG.debug('Getting usages for project_id %s from placement',
project_id)