From 02fa59d280e37da96ce0e33d104b802fd63c2fdc Mon Sep 17 00:00:00 2001 From: Sarafraj Singh Date: Tue, 11 Oct 2016 14:24:13 -0500 Subject: [PATCH] conf: Remove deprecated 'compute_stats_class' opt Change-Id: I9efbd7ba066705d5fa2353587237d197015a4f25 Blueprint centralize-config-options-ocata --- nova/compute/resource_tracker.py | 4 ++-- nova/conf/compute.py | 14 -------------- nova/db/sqlalchemy/models.py | 2 ++ ...eprecated-compute-options-dbf2be75d6bdbcc8.yaml | 5 +++++ 4 files changed, 9 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-compute-options-dbf2be75d6bdbcc8.yaml diff --git a/nova/compute/resource_tracker.py b/nova/compute/resource_tracker.py index 4436f71b3bcb..56943b315e32 100644 --- a/nova/compute/resource_tracker.py +++ b/nova/compute/resource_tracker.py @@ -22,10 +22,10 @@ import copy from oslo_log import log as logging from oslo_serialization import jsonutils -from oslo_utils import importutils from nova.compute import claims from nova.compute import monitors +from nova.compute import stats from nova.compute import task_states from nova.compute import vm_states import nova.conf @@ -87,7 +87,7 @@ class ResourceTracker(object): self.pci_tracker = None self.nodename = nodename self.compute_node = None - self.stats = importutils.import_object(CONF.compute_stats_class) + self.stats = stats.Stats() self.tracked_instances = {} self.tracked_migrations = {} monitor_handler = monitors.MonitorHandler(self) diff --git a/nova/conf/compute.py b/nova/conf/compute.py index 47e790fd2d6c..3e7488160519 100644 --- a/nova/conf/compute.py +++ b/nova/conf/compute.py @@ -168,20 +168,6 @@ Possible values: * Any positive integer representing amount of memory in MB to reserve for the host. -"""), - cfg.StrOpt('compute_stats_class', - default='nova.compute.stats.Stats', - deprecated_for_removal=True, - deprecated_since='13.0.0', - help=""" -Abstracts out managing compute host stats to pluggable class. This class -manages and updates stats for the local compute host after an instance -is changed. These configurable compute stats may be useful for a -particular scheduler implementation. - -Possible values - - * A string representing fully qualified class name. """), ] diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index 428e68550b3d..f7d4056388a5 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -539,6 +539,8 @@ class Reservation(BASE, NovaBase, models.SoftDeleteMixin): 'QuotaUsage.deleted == 0)') +# TODO(macsz) This class can be removed. It might need a DB migration to drop +# this. class Snapshot(BASE, NovaBase, models.SoftDeleteMixin): """Represents a block storage device that can be attached to a VM.""" __tablename__ = 'snapshots' diff --git a/releasenotes/notes/remove-deprecated-compute-options-dbf2be75d6bdbcc8.yaml b/releasenotes/notes/remove-deprecated-compute-options-dbf2be75d6bdbcc8.yaml new file mode 100644 index 000000000000..1e388cc84ce6 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-compute-options-dbf2be75d6bdbcc8.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The ``compute_stats_class`` options is deprecated and have been removed + from the ``default`` group of nova.conf. \ No newline at end of file