From ceb1c2288fdd8bff84bdaa6a371bcb7d2ab41382 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 19 Apr 2021 11:38:42 -0400 Subject: [PATCH] Remove unused _get_non_shared_target_hosts from cmd/manage The code that called this method was removed in 230bda Fix online data migrations Change-Id: I3f796ea3a3d1244c06d094f4af852b844b34f2d5 --- cinder/cmd/manage.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index 473e579695d..df8a0adc6ef 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -66,7 +66,6 @@ import tabulate # Need to register global_opts from cinder.backup import rpcapi as backup_rpcapi from cinder.common import config # noqa -from cinder.common import constants from cinder import context from cinder import db from cinder.db import migration as db_migration @@ -97,27 +96,6 @@ RPC_VERSIONS = { OVO_VERSION = ovo_base.OBJ_VERSIONS.get_current() -def _get_non_shared_target_hosts(ctxt): - hosts = [] - numvols_needing_update = 0 - rpc.init(CONF) - rpcapi = volume_rpcapi.VolumeAPI() - - services = objects.ServiceList.get_all_by_topic(ctxt, - constants.VOLUME_TOPIC) - for service in services: - capabilities = rpcapi.get_capabilities(ctxt, service.host, True) - # Select only non iSCSI connections and iSCSI that are explicit - if (capabilities.get('storage_protocol') != 'iSCSI' or - not capabilities.get('shared_targets', True)): - hosts.append(service.host) - numvols_needing_update += db_api.model_query( - ctxt, models.Volume).filter_by( - shared_targets=True, - service_uuid=service.uuid).count() - return hosts, numvols_needing_update - - # Decorators for actions def args(*args, **kwargs): args = list(args)