diff options
| author | Matthew Sherborne <msherborne@gmail.com> | 2013-05-03 10:29:45 +1000 |
|---|---|---|
| committer | Matthew Sherborne <msherborne@gmail.com> | 2013-05-10 22:10:49 +1000 |
| commit | 1f2aba5f706f882663e770bc8dac031627c91f39 (patch) | |
| tree | fb0781f5c478bb80e30cf1f1485733462b1ca831 /openstack | |
| parent | 6a4800d8cc36812835dca796895bafec940b2ce5 (diff) | |
| download | oslo-1f2aba5f706f882663e770bc8dac031627c91f39.tar.gz oslo-1f2aba5f706f882663e770bc8dac031627c91f39.tar.xz oslo-1f2aba5f706f882663e770bc8dac031627c91f39.zip | |
Renames filter to base_filter and weight to base_weight
filter is a python builtin function so importing it pollutes ones name
space.
It is now renamed to base_filter.
We also rename weight to base_weight, just to be consistent in the
naming conventions.
We add a test for base_filter.
Fixes bug 1175829
Change-Id: I46e0fa696d2f39081b5568c701b0a70c54f271ab
Diffstat (limited to 'openstack')
| -rw-r--r-- | openstack/common/scheduler/base_filter.py (renamed from openstack/common/scheduler/filter.py) | 0 | ||||
| -rw-r--r-- | openstack/common/scheduler/base_weight.py (renamed from openstack/common/scheduler/weight.py) | 0 | ||||
| -rw-r--r-- | openstack/common/scheduler/filters/__init__.py | 6 | ||||
| -rw-r--r-- | openstack/common/scheduler/weights/__init__.py | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/openstack/common/scheduler/filter.py b/openstack/common/scheduler/base_filter.py index 52c18af..52c18af 100644 --- a/openstack/common/scheduler/filter.py +++ b/openstack/common/scheduler/base_filter.py diff --git a/openstack/common/scheduler/weight.py b/openstack/common/scheduler/base_weight.py index 82f1d25..82f1d25 100644 --- a/openstack/common/scheduler/weight.py +++ b/openstack/common/scheduler/base_weight.py diff --git a/openstack/common/scheduler/filters/__init__.py b/openstack/common/scheduler/filters/__init__.py index d3a99a5..6fb5a13 100644 --- a/openstack/common/scheduler/filters/__init__.py +++ b/openstack/common/scheduler/filters/__init__.py @@ -18,12 +18,12 @@ Scheduler host filters """ from openstack.common import log as logging -from openstack.common.scheduler import filter +from openstack.common.scheduler import base_filter LOG = logging.getLogger(__name__) -class BaseHostFilter(filter.BaseFilter): +class BaseHostFilter(base_filter.BaseFilter): """Base class for host filters.""" def _filter_one(self, obj, filter_properties): """Return True if the object passes the filter, otherwise False.""" @@ -36,6 +36,6 @@ class BaseHostFilter(filter.BaseFilter): raise NotImplementedError() -class HostFilterHandler(filter.BaseFilterHandler): +class HostFilterHandler(base_filter.BaseFilterHandler): def __init__(self, namespace): super(HostFilterHandler, self).__init__(BaseHostFilter, namespace) diff --git a/openstack/common/scheduler/weights/__init__.py b/openstack/common/scheduler/weights/__init__.py index c05c04e..e2eb04a 100644 --- a/openstack/common/scheduler/weights/__init__.py +++ b/openstack/common/scheduler/weights/__init__.py @@ -18,10 +18,10 @@ Scheduler host weights """ -from openstack.common.scheduler import weight +from openstack.common.scheduler import base_weight -class WeighedHost(weight.WeighedObject): +class WeighedHost(base_weight.WeighedObject): def to_dict(self): return { 'weight': self.weight, @@ -33,12 +33,12 @@ class WeighedHost(weight.WeighedObject): (self.obj.host, self.weight)) -class BaseHostWeigher(weight.BaseWeigher): +class BaseHostWeigher(base_weight.BaseWeigher): """Base class for host weights.""" pass -class HostWeightHandler(weight.BaseWeightHandler): +class HostWeightHandler(base_weight.BaseWeightHandler): object_class = WeighedHost def __init__(self, namespace): |
