Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
telecom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
telecom
Commits
72ec635d
Commit
72ec635d
authored
Sep 12, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: handle ingestion of modified files
parent
891e2bb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+17
-8
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
...l_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
+4
-0
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
72ec635d
...
...
@@ -31,14 +31,23 @@ try:
if
data_ingestion
is
not
None
:
if
data_ingestion
.
getSimulationState
()
!=
'started'
:
# CHECK HASH
#if hash is equal:
context
.
logEntry
(
"An older ingestion for reference %s was already done."
%
data_ingestion_reference
)
raise
ValueError
(
"An older ingestion for reference %s was already done."
%
data_ingestion_reference
)
#else:
#portal.ERP5Site_invalidateIngestionObjects(data_ingestion.getReference())
#if data_ingestion is None:
modified
=
False
if
size
!=
None
and
size
!=
""
:
data_stream
=
portal_catalog
.
getResultValue
(
portal_type
=
'Data Stream'
,
validation_state
=
'validated'
,
reference
=
data_ingestion_reference
)
if
size
!=
data_stream
.
getSize
():
modified
=
True
elif
hash_value
!=
None
and
hash_value
!=
""
and
hash_value
!=
data_stream
.
getVersion
():
modified
=
True
if
not
modified
:
context
.
logEntry
(
"An older ingestion for reference %s was already done."
%
data_ingestion_reference
)
raise
ValueError
(
"An older ingestion for reference %s was already done."
%
data_ingestion_reference
)
else
:
context
.
logEntry
(
"Ingestion of modified file. Old version will be invalidated."
)
portal
.
ERP5Site_invalidateIngestionObjects
(
data_ingestion_reference
)
specialise_value_list
=
[
x
.
getObject
()
for
x
in
portal_catalog
.
searchResults
(
portal_type
=
'Data Supply'
,
reference
=
'embulk'
,
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
View file @
72ec635d
...
...
@@ -16,6 +16,7 @@ try:
# remove supplier and eof from reference
data_ingestion_reference
=
'/'
.
join
(
reference
.
split
(
'/'
)[
1
:
-
3
])
EOF
=
reference
.
split
(
'/'
)[
-
3
]
size
=
reference
.
split
(
'/'
)[
-
2
]
if
data_ingestion_reference
is
""
:
context
.
logEntry
(
"[ERROR] Data Ingestion reference is not well formated"
)
...
...
@@ -39,6 +40,9 @@ try:
pass
return
FALSE
if
size
!=
""
and
size
!=
None
:
# this is a modified file
return
FALSE
context
.
logEntry
(
"[ERROR] Data Ingestion reference %s already exists"
%
data_ingestion_reference
)
return
TRUE
except
Exception
as
e
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment