summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-23 07:29:57 +0000
committerGerrit Code Review <review@openstack.org>2013-05-23 07:29:57 +0000
commit6b4bf59c410ef1339dda1010bc3b68c1869bb63f (patch)
treef5910515603dc514aa8157bdf6992f466cda903d
parentaf7048590dac77806dd3e7c97a736fda52c2389b (diff)
parent3f6a526b580814c91bd6afdd997dacd5ec8e9638 (diff)
downloadnova-6b4bf59c410ef1339dda1010bc3b68c1869bb63f.tar.gz
nova-6b4bf59c410ef1339dda1010bc3b68c1869bb63f.tar.xz
nova-6b4bf59c410ef1339dda1010bc3b68c1869bb63f.zip
Merge "Remove locals() from scheduler filters"
-rw-r--r--nova/scheduler/filters/aggregate_instance_extra_specs.py4
-rw-r--r--nova/scheduler/filters/compute_capabilities_filter.py2
-rw-r--r--nova/scheduler/filters/compute_filter.py4
-rw-r--r--nova/scheduler/filters/disk_filter.py4
-rw-r--r--nova/scheduler/filters/image_props_filter.py12
-rw-r--r--nova/scheduler/filters/io_ops_filter.py4
-rw-r--r--nova/scheduler/filters/num_instances_filter.py3
-rw-r--r--nova/scheduler/filters/ram_filter.py4
-rw-r--r--nova/scheduler/filters/retry_filter.py4
9 files changed, 27 insertions, 14 deletions
diff --git a/nova/scheduler/filters/aggregate_instance_extra_specs.py b/nova/scheduler/filters/aggregate_instance_extra_specs.py
index 6e1e47f68..904da25ef 100644
--- a/nova/scheduler/filters/aggregate_instance_extra_specs.py
+++ b/nova/scheduler/filters/aggregate_instance_extra_specs.py
@@ -47,13 +47,13 @@ class AggregateInstanceExtraSpecsFilter(filters.BaseHostFilter):
aggregate_vals = metadata.get(key, None)
if not aggregate_vals:
LOG.debug(_("%(host_state)s fails instance_type extra_specs "
- "requirements"), locals())
+ "requirements"), {'host_state': host_state})
return False
for aggregate_val in aggregate_vals:
if extra_specs_ops.match(aggregate_val, req):
break
else:
LOG.debug(_("%(host_state)s fails instance_type extra_specs "
- "requirements"), locals())
+ "requirements"), {'host_state': host_state})
return False
return True
diff --git a/nova/scheduler/filters/compute_capabilities_filter.py b/nova/scheduler/filters/compute_capabilities_filter.py
index e559c18a8..232e98880 100644
--- a/nova/scheduler/filters/compute_capabilities_filter.py
+++ b/nova/scheduler/filters/compute_capabilities_filter.py
@@ -55,6 +55,6 @@ class ComputeCapabilitiesFilter(filters.BaseHostFilter):
if not self._satisfies_extra_specs(host_state.capabilities,
instance_type):
LOG.debug(_("%(host_state)s fails instance_type extra_specs "
- "requirements"), locals())
+ "requirements"), {'host_state': host_state})
return False
return True
diff --git a/nova/scheduler/filters/compute_filter.py b/nova/scheduler/filters/compute_filter.py
index f6c643c1c..e4255a3e7 100644
--- a/nova/scheduler/filters/compute_filter.py
+++ b/nova/scheduler/filters/compute_filter.py
@@ -38,10 +38,10 @@ class ComputeFilter(filters.BaseHostFilter):
alive = self.servicegroup_api.service_is_up(service)
if not alive or service['disabled']:
LOG.debug(_("%(host_state)s is disabled or has not been "
- "heard from in a while"), locals())
+ "heard from in a while"), {'host_state': host_state})
return False
if not capabilities.get("enabled", True):
LOG.debug(_("%(host_state)s is disabled via capabilities"),
- locals())
+ {'host_state': host_state})
return False
return True
diff --git a/nova/scheduler/filters/disk_filter.py b/nova/scheduler/filters/disk_filter.py
index 517d43510..37911d5d5 100644
--- a/nova/scheduler/filters/disk_filter.py
+++ b/nova/scheduler/filters/disk_filter.py
@@ -46,7 +46,9 @@ class DiskFilter(filters.BaseHostFilter):
if not usable_disk_mb >= requested_disk:
LOG.debug(_("%(host_state)s does not have %(requested_disk)s MB "
"usable disk, it only has %(usable_disk_mb)s MB usable "
- "disk."), locals())
+ "disk."), {'host_state': host_state,
+ 'requested_disk': requested_disk,
+ 'usable_disk_mb': usable_disk_mb})
return False
disk_gb_limit = disk_mb_limit / 1024
diff --git a/nova/scheduler/filters/image_props_filter.py b/nova/scheduler/filters/image_props_filter.py
index 185d2f4e4..b25140e98 100644
--- a/nova/scheduler/filters/image_props_filter.py
+++ b/nova/scheduler/filters/image_props_filter.py
@@ -47,7 +47,7 @@ class ImagePropertiesFilter(filters.BaseHostFilter):
if not supp_instances:
LOG.debug(_("Instance contains properties %(image_props)s, "
"but no corresponding capabilities are advertised "
- "by the compute node"), locals())
+ "by the compute node"), {'image_props': image_props})
return False
def _compare_props(props, other_props):
@@ -60,12 +60,16 @@ class ImagePropertiesFilter(filters.BaseHostFilter):
if _compare_props(checked_img_props, supp_inst):
LOG.debug(_("Instance properties %(image_props)s "
"are satisfied by compute host capabilities "
- "%(capabilities)s"), locals())
+ "%(capabilities)s"),
+ {'image_props': image_props,
+ 'capabilities': capabilities})
return True
LOG.debug(_("Instance contains properties %(image_props)s "
"that are not provided by the compute node "
- "capabilities %(capabilities)s"), locals())
+ "capabilities %(capabilities)s"),
+ {'image_props': image_props,
+ 'capabilities': capabilities})
return False
def host_passes(self, host_state, filter_properties):
@@ -80,6 +84,6 @@ class ImagePropertiesFilter(filters.BaseHostFilter):
if not self._instance_supported(capabilities, image_props):
LOG.debug(_("%(host_state)s does not support requested "
- "instance_properties"), locals())
+ "instance_properties"), {'host_state': host_state})
return False
return True
diff --git a/nova/scheduler/filters/io_ops_filter.py b/nova/scheduler/filters/io_ops_filter.py
index 7d3337c1a..255563022 100644
--- a/nova/scheduler/filters/io_ops_filter.py
+++ b/nova/scheduler/filters/io_ops_filter.py
@@ -40,5 +40,7 @@ class IoOpsFilter(filters.BaseHostFilter):
passes = num_io_ops < max_io_ops
if not passes:
LOG.debug(_("%(host_state)s fails I/O ops check: Max IOs per host "
- "is set to %(max_io_ops)s"), locals())
+ "is set to %(max_io_ops)s"),
+ {'host_state': host_state,
+ 'max_io_ops': max_io_ops})
return passes
diff --git a/nova/scheduler/filters/num_instances_filter.py b/nova/scheduler/filters/num_instances_filter.py
index 06b5b5b73..2ed4a5454 100644
--- a/nova/scheduler/filters/num_instances_filter.py
+++ b/nova/scheduler/filters/num_instances_filter.py
@@ -38,5 +38,6 @@ class NumInstancesFilter(filters.BaseHostFilter):
if not passes:
LOG.debug(_("%(host_state)s fails num_instances check: Max "
"instances per host is set to %(max_instances)s"),
- locals())
+ {'host_state': host_state,
+ 'max_instances': max_instances})
return passes
diff --git a/nova/scheduler/filters/ram_filter.py b/nova/scheduler/filters/ram_filter.py
index fdf189735..7e20e3d15 100644
--- a/nova/scheduler/filters/ram_filter.py
+++ b/nova/scheduler/filters/ram_filter.py
@@ -45,7 +45,9 @@ class RamFilter(filters.BaseHostFilter):
if not usable_ram >= requested_ram:
LOG.debug(_("%(host_state)s does not have %(requested_ram)s MB "
"usable ram, it only has %(usable_ram)s MB usable ram."),
- locals())
+ {'host_state': host_state,
+ 'requested_ram': requested_ram,
+ 'usable_ram': usable_ram})
return False
# save oversubscription limit for compute node to test against:
diff --git a/nova/scheduler/filters/retry_filter.py b/nova/scheduler/filters/retry_filter.py
index d49ad1c36..f82488527 100644
--- a/nova/scheduler/filters/retry_filter.py
+++ b/nova/scheduler/filters/retry_filter.py
@@ -39,7 +39,9 @@ class RetryFilter(filters.BaseHostFilter):
pass_msg = "passes" if passes else "fails"
LOG.debug(_("Host %(host)s %(pass_msg)s. Previously tried hosts: "
- "%(hosts)s") % locals())
+ "%(hosts)s") % {'host': host,
+ 'pass_msg': pass_msg,
+ 'hosts': hosts})
# Host passes if it's not in the list of previously attempted hosts:
return passes