From 8d48f69189572afaeae095973c8906646caedf69 Mon Sep 17 00:00:00 2001 From: Jay Lau Date: Tue, 6 May 2014 18:02:09 +0800 Subject: [PATCH] Some code clean up in climate_filter.py 1) Use () for long string 2) Enable I18N for audit log 3) Remove else: for a simple if statement Change-Id: Id0c64c04aa325483f9d4225a31fde7f79720cc84 --- climatenova/scheduler/filters/climate_filter.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/climatenova/scheduler/filters/climate_filter.py b/climatenova/scheduler/filters/climate_filter.py index cc92908..4d64a81 100644 --- a/climatenova/scheduler/filters/climate_filter.py +++ b/climatenova/scheduler/filters/climate_filter.py @@ -84,14 +84,14 @@ class ClimateFilter(filters.BaseHostFilter): if agg['availability_zone'].startswith( cfg.CONF['climate:physical:host'].climate_az_prefix): pools.append(agg) - if agg['name'] == \ - cfg.CONF['climate:physical:host'].aggregate_freepool_name: + if agg['name'] == ( + cfg.CONF['climate:physical:host'].aggregate_freepool_name): pools.append(agg) if pools: if not requested_pools: # Host is in a Pool and none requested - LOG.audit("In a user pool or in the freepool") + LOG.audit(_("In a user pool or in the freepool")) return False # Find aggregate which matches Pool @@ -127,5 +127,4 @@ class ClimateFilter(filters.BaseHostFilter): if requested_pools: # Host is not in a Pool and Pool requested return False - else: - return True + return True