Make the Pipeline inmutable

This patch makes pipeline inmutable by removing the append method.
the pipeline metadata now returns a pipeline instance.

Change-Id: I9b90933a83ca1d423d3718f438d3717c39ef78d4
Closes-Bug: #1433158
This commit is contained in:
dynarro 2015-03-17 18:20:29 +01:00 committed by Victoria Martinez de la Cruz
parent 9778098449
commit 286e11f081
2 changed files with 5 additions and 8 deletions

View File

@ -45,9 +45,6 @@ class Pipeline(object):
def __init__(self, pipeline=None):
self._pipeline = pipeline and list(pipeline) or []
def append(self, stage):
self._pipeline.append(stage)
@decorators.memoized_getattr
def __getattr__(self, name):
with self.consumer_for(name) as consumer:

View File

@ -78,7 +78,7 @@ def _get_storage_pipeline(resource_name, conf):
{'stage': ns, 'ex': str(exc)})
continue
return common.Pipeline(pipeline)
return pipeline
class DataDriver(base.DataDriverBase):
@ -109,22 +109,22 @@ class DataDriver(base.DataDriverBase):
def queue_controller(self):
stages = _get_storage_pipeline('queue', self.conf)
stages.append(self._storage.queue_controller)
return stages
return common.Pipeline(stages)
@decorators.lazy_property(write=False)
def message_controller(self):
stages = _get_storage_pipeline('message', self.conf)
stages.append(self._storage.message_controller)
return stages
return common.Pipeline(stages)
@decorators.lazy_property(write=False)
def claim_controller(self):
stages = _get_storage_pipeline('claim', self.conf)
stages.append(self._storage.claim_controller)
return stages
return common.Pipeline(stages)
@decorators.lazy_property(write=False)
def subscription_controller(self):
stages = _get_storage_pipeline('subscription', self.conf)
stages.append(self._storage.subscription_controller)
return stages
return common.Pipeline(stages)