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
This commit is contained in:
parent
5c3d416eae
commit
8d48f69189
@ -84,14 +84,14 @@ class ClimateFilter(filters.BaseHostFilter):
|
|||||||
if agg['availability_zone'].startswith(
|
if agg['availability_zone'].startswith(
|
||||||
cfg.CONF['climate:physical:host'].climate_az_prefix):
|
cfg.CONF['climate:physical:host'].climate_az_prefix):
|
||||||
pools.append(agg)
|
pools.append(agg)
|
||||||
if agg['name'] == \
|
if agg['name'] == (
|
||||||
cfg.CONF['climate:physical:host'].aggregate_freepool_name:
|
cfg.CONF['climate:physical:host'].aggregate_freepool_name):
|
||||||
pools.append(agg)
|
pools.append(agg)
|
||||||
|
|
||||||
if pools:
|
if pools:
|
||||||
if not requested_pools:
|
if not requested_pools:
|
||||||
# Host is in a Pool and none requested
|
# 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
|
return False
|
||||||
|
|
||||||
# Find aggregate which matches Pool
|
# Find aggregate which matches Pool
|
||||||
@ -127,5 +127,4 @@ class ClimateFilter(filters.BaseHostFilter):
|
|||||||
if requested_pools:
|
if requested_pools:
|
||||||
# Host is not in a Pool and Pool requested
|
# Host is not in a Pool and Pool requested
|
||||||
return False
|
return False
|
||||||
else:
|
return True
|
||||||
return True
|
|
||||||
|
Loading…
Reference in New Issue
Block a user