summaryrefslogtreecommitdiffstats
path: root/nova/scheduler/driver.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-11-04 21:32:51 +0000
committerMark McLoughlin <markmc@redhat.com>2012-11-04 22:33:01 +0000
commit7931f9a2a556bf38e19f501cac345264ff771d5c (patch)
tree53c74d6ba844bd787670ec113239864e289b9cf9 /nova/scheduler/driver.py
parent8ce58defbe560b1da34d991b38ac64a9b4c8d654 (diff)
downloadnova-7931f9a2a556bf38e19f501cac345264ff771d5c.tar.gz
nova-7931f9a2a556bf38e19f501cac345264ff771d5c.tar.xz
nova-7931f9a2a556bf38e19f501cac345264ff771d5c.zip
Switch from FLAGS to CONF in nova.scheduler
Use the global CONF variable instead of FLAGS. This is purely a cleanup since FLAGS is already just another reference to CONF. We leave the nova.flags imports until a later cleanup commit since removing them may cause unpredictable problems due to config options not being registered. Change-Id: Ia3f66aec300fd88e91cef926da735f9e95aa2cc2
Diffstat (limited to 'nova/scheduler/driver.py')
-rw-r--r--nova/scheduler/driver.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py
index 13f0029ee..f93268906 100644
--- a/nova/scheduler/driver.py
+++ b/nova/scheduler/driver.py
@@ -53,8 +53,8 @@ scheduler_driver_opts = [
help='Maximum number of attempts to schedule an instance'),
]
-FLAGS = flags.FLAGS
-FLAGS.register_opts(scheduler_driver_opts)
+CONF = config.CONF
+CONF.register_opts(scheduler_driver_opts)
CONF = config.CONF
CONF.import_opt('instances_path', 'nova.compute.manager')
@@ -107,7 +107,7 @@ def cast_to_compute_host(context, host, method, **kwargs):
instance_update_db(context, instance_uuid)
rpc.cast(context,
- rpc.queue_get_for(context, FLAGS.compute_topic, host),
+ rpc.queue_get_for(context, CONF.compute_topic, host),
{"method": method, "args": kwargs})
LOG.debug(_("Casted '%(method)s' to compute '%(host)s'") % locals())
@@ -115,7 +115,7 @@ def cast_to_compute_host(context, host, method, **kwargs):
def cast_to_host(context, topic, host, method, **kwargs):
"""Generic cast to host"""
- topic_mapping = {FLAGS.compute_topic: cast_to_compute_host}
+ topic_mapping = {CONF.compute_topic: cast_to_compute_host}
func = topic_mapping.get(topic)
if func:
@@ -151,7 +151,7 @@ class Scheduler(object):
def __init__(self):
self.host_manager = importutils.import_object(
- FLAGS.scheduler_host_manager)
+ CONF.scheduler_host_manager)
self.compute_api = compute_api.API()
self.compute_rpcapi = compute_rpcapi.ComputeAPI()