diff options
author | Dan Smith <dansmith@redhat.com> | 2022-08-11 09:50:30 -0700 |
---|---|---|
committer | Dan Smith <dansmith@redhat.com> | 2022-08-18 07:22:37 -0700 |
commit | c178d9360665c219cbcc71c9f37b9e6e3055a5e5 (patch) | |
tree | 319663342124fe6a976efc273092a0c06f0bfbea /nova/cmd | |
parent | 627af67f5e631e8e1b23aa1527517a6cd6abd462 (diff) | |
download | nova-c178d9360665c219cbcc71c9f37b9e6e3055a5e5.tar.gz |
Unify placement client singleton implementations
We have many places where we implement singleton behavior for the
placement client. This unifies them into a single place and
implementation. Not only does this DRY things up, but may cause us
to initialize it fewer times and also allows for emitting a common
set of error messages about expected failures for better
troubleshooting.
Change-Id: Iab8a791f64323f996e1d6e6d5a7e7a7c34eb4fb3
Related-Bug: #1846820
Diffstat (limited to 'nova/cmd')
-rw-r--r-- | nova/cmd/manage.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index 32b0dd57f8..08b8ebb310 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -2209,7 +2209,7 @@ class PlacementCommands(object): output(_('No cells to process.')) return 4 - placement = report.SchedulerReportClient() + placement = report.report_client_singleton() neutron = None if heal_port_allocations: @@ -2710,7 +2710,7 @@ class PlacementCommands(object): if verbose: output = lambda msg: print(msg) - placement = report.SchedulerReportClient() + placement = report.report_client_singleton() # Resets two in-memory dicts for knowing instances per compute node self.cn_uuid_mapping = collections.defaultdict(tuple) self.instances_mapping = collections.defaultdict(list) |