Commit 9cbc3708 authored by Ivan Tyagov's avatar Ivan Tyagov

Cleanup trailing spaces.

parent b33b8afe
......@@ -28,25 +28,25 @@ from zExceptions import BadRequest, NotFound
class IngestionPolicy(Folder):
"""
A policy for ingesting raw (usually) data inside ERP5.
Every Sensor, Data Acquisition Unit or Data Aggregation Unit will be
Every Sensor, Data Acquisition Unit or Data Aggregation Unit will be
configured to access a different policy.
Each policy will have a python script which based on input data will find
respective Data Supply which itself contains all required information for
Each policy will have a python script which based on input data will find
respective Data Supply which itself contains all required information for
later ingestion and analytics.
"""
meta_type = 'ERP5 Ingestion Policy'
portal_type = 'Ingestion Policy'
# Declarative security
security = ClassSecurityInfo()
def unpack(self, data):
"""
Unpack data coming from fluentd. Handly alias.
Unpack data coming from fluentd. Handy alias.
"""
return self.portal_ingestion_policies.unpack(data)
security.declarePublic('ingest')
def ingest(self, **kw):
"""
......@@ -65,23 +65,23 @@ class IngestionPolicy(Folder):
self.REQUEST.form['data_chunk'] = self.REQUEST._file.read()
finally:
environ['REQUEST_METHOD'] = method
tag_parsing_script_id = self.getScriptId()
if tag_parsing_script_id is None:
raise NotFound('No tag parsing script found.')
tag_parsing_script = getattr(self, tag_parsing_script_id, None)
if tag_parsing_script is None:
raise NotFound('No tag parsing script found.')
# XXX Compatibility with old ingestion. Must be dropped before merging
# with wendelin master
if tag_parsing_script_id == "ERP5Site_handleDefaultFluentdIngestion":
return tag_parsing_script(**kw)
reference = self.REQUEST.get('reference')
data_chunk = self.REQUEST.get('data_chunk')
data_chunk = self.REQUEST.get('data_chunk')
# the script parses the fluentd tag (reference) and returns a dictionary
# which describes the ingestion movement. Then we use this dictionary to
......@@ -104,7 +104,7 @@ class IngestionPolicy(Folder):
data_operation_script = getattr(self, data_operation_script_id, None)
if data_operation_script is None:
raise NotFound('No data operation script found.')
ingestion_operation, parameter_dict = data_operation_script(movement_dict,\
reference)
......@@ -114,9 +114,9 @@ class IngestionPolicy(Folder):
ingestion_script_id = ingestion_operation.getScriptId()
if ingestion_script_id is None:
raise NotFound('No ingestion operation script id defined.')
ingestion_script = getattr(self, ingestion_script_id, None)
if ingestion_script is None:
raise NotFound('No such ingestion script found: %s' %ingestion_script_id)
ingestion_script(data_chunk=data_chunk, **parameter_dict)
ingestion_script(data_chunk=data_chunk, **parameter_dict)
\ No newline at end of file
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>IngestionPolicy</string> </value>
......@@ -53,28 +47,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -87,7 +66,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -96,7 +75,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment