From 71bd5355a292ac24fda54849aea1cc6ad2f2e338 Mon Sep 17 00:00:00 2001 From: Hiroaki Kobayashi Date: Thu, 8 Jun 2017 16:27:39 +0900 Subject: [PATCH] Remove the Climate filter Remove the Climate filter that has been deprecated in Ocata. Change-Id: I2c1d0e5c15338868ba77f25893b38238009cb5c6 --- blazarnova/scheduler/filters/blazar_filter.py | 32 ++++--------------- climatenova/__init__.py | 5 --- 2 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 climatenova/__init__.py diff --git a/blazarnova/scheduler/filters/blazar_filter.py b/blazarnova/scheduler/filters/blazar_filter.py index 3228c47..f99ed7b 100644 --- a/blazarnova/scheduler/filters/blazar_filter.py +++ b/blazarnova/scheduler/filters/blazar_filter.py @@ -24,28 +24,20 @@ from oslo_log import log as logging LOG = logging.getLogger(__name__) -deprecated_group = 'climate:physical:host' opts = [ cfg.StrOpt('aggregate_freepool_name', default='freepool', help='Name of the special aggregate where all hosts ' - 'are candidate for physical host reservation', - deprecated_group=deprecated_group), + 'are candidate for physical host reservation'), cfg.StrOpt('project_id_key', default='blazar:tenant', - deprecated_name='tenant_id_key', - help='Aggregate metadata value for key matching project_id', - deprecated_group=deprecated_group), + help='Aggregate metadata value for key matching project_id'), cfg.StrOpt('blazar_owner', default='blazar:owner', - deprecated_name='climate_owner', - help='Aggregate metadata key for knowing owner project_id', - deprecated_group=deprecated_group), + help='Aggregate metadata key for knowing owner project_id'), cfg.StrOpt('blazar_az_prefix', default='blazar:', - deprecated_name='climate_az_prefix', - help='Prefix for Availability Zones created by Blazar', - deprecated_group=deprecated_group), + help='Prefix for Availability Zones created by Blazar') ] cfg.CONF.register_opts(opts, 'blazar:physical:host') @@ -84,9 +76,8 @@ class BlazarFilter(filters.BaseHostFilter): aggregates = host_state.aggregates pools = [] for agg in aggregates: - if (str(agg.availability_zone).startswith( - cfg.CONF['blazar:physical:host'].blazar_az_prefix) - or str(agg.availability_zone).startswith('climate:')): + if str(agg.availability_zone).startswith( + cfg.CONF['blazar:physical:host'].blazar_az_prefix): pools.append(agg) if agg.name == ( cfg.CONF['blazar:physical:host'].aggregate_freepool_name): @@ -114,10 +105,7 @@ class BlazarFilter(filters.BaseHostFilter): # until we modify the reservation pool for including the # project_id key as for any other extra project owner = cfg.CONF['blazar:physical:host'].blazar_owner - # NOTE(pafuent): climate:owner was the previous default - # value. - owner_project_id = pool.metadata.get( - owner, pool.metadata.get('climate:owner')) + owner_project_id = pool.metadata.get(owner) if owner_project_id == spec_obj.project_id: return True LOG.info(_("Unauthorized request to use Pool " @@ -135,9 +123,3 @@ class BlazarFilter(filters.BaseHostFilter): # Host is not in a Pool and Pool requested return False return True - - -# For backward compatibility. This should be done in this way due to how Nova -# imports the filters -class ClimateFilter(BlazarFilter): - pass diff --git a/climatenova/__init__.py b/climatenova/__init__.py deleted file mode 100644 index 255d8b6..0000000 --- a/climatenova/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import os - -__path__ = [ - os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), - 'blazarnova')]