Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin-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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
wendelin-telecom
Commits
c53925b1
Commit
c53925b1
authored
Oct 04, 2024
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin_telecom_base: Update ERP5Site_registerOrs parameter name
parent
d29e4e3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
...ortal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
+9
-9
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.xml
...rtal_skins/wendelin_telecom_base/ERP5Site_registerOrs.xml
+1
-1
No files found.
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
View file @
c53925b1
...
@@ -14,29 +14,29 @@ response_dict = {}
...
@@ -14,29 +14,29 @@ response_dict = {}
# Check if ORS is already registered
# Check if ORS is already registered
data_acquisition_unit
=
context
.
portal_catalog
.
getResultValue
(
data_acquisition_unit
=
context
.
portal_catalog
.
getResultValue
(
portal_type
=
'Data Acquisition Unit'
,
portal_type
=
'Data Acquisition Unit'
,
reference
=
ors
_tag
,
reference
=
fluentbit
_tag
,
validation_state
=
'validated'
validation_state
=
'validated'
)
)
if
data_acquisition_unit
:
if
data_acquisition_unit
:
error_msg
=
"ORS with tag %s already exists."
%
ors
_tag
error_msg
=
"ORS with tag %s already exists."
%
fluentbit
_tag
response_dict
=
dict
(
error_msg
=
error_msg
)
response_dict
=
dict
(
error_msg
=
error_msg
)
return
json
.
dumps
(
response_dict
)
return
json
.
dumps
(
response_dict
)
ors_tag_components
=
ors
_tag
.
split
(
'_'
)
fluentbit_tag_components
=
fluentbit
_tag
.
split
(
'_'
)
if
len
(
ors
_tag_components
)
!=
3
:
if
len
(
fluentbit
_tag_components
)
!=
3
:
error_msg
=
"Invalid ORS tag %s found"
%
ors
_tag
error_msg
=
"Invalid ORS tag %s found"
%
fluentbit
_tag
response_dict
=
dict
(
error_msg
=
error_msg
)
response_dict
=
dict
(
error_msg
=
error_msg
)
return
json
.
dumps
(
response_dict
)
return
json
.
dumps
(
response_dict
)
ors_hostname
,
ors_comp_id
=
ors_tag_components
[
0
],
ors
_tag_components
[
1
]
ors_hostname
,
ors_comp_id
=
fluentbit_tag_components
[
0
],
fluentbit
_tag_components
[
1
]
ors
_tag_prefix
=
'%s_%s'
%
(
ors_hostname
,
ors_comp_id
)
fluentbit
_tag_prefix
=
'%s_%s'
%
(
ors_hostname
,
ors_comp_id
)
# Detect the case where an existing ORS has changed the last component of its tag:
# Detect the case where an existing ORS has changed the last component of its tag:
# Search for all Data Acquisition Units with the same first two tag components and get their related destination_project
# Search for all Data Acquisition Units with the same first two tag components and get their related destination_project
related_data_acquisition_unit_list
=
[
related_data_acquisition_unit_list
=
[
related_data_acquisition_unit
for
related_data_acquisition_unit
\
related_data_acquisition_unit
for
related_data_acquisition_unit
\
in
portal
.
data_acquisition_unit_module
.
contentValues
(
filter
=
{
'portal_type'
:
'Data Acquisition Unit'
})
\
in
portal
.
data_acquisition_unit_module
.
contentValues
(
filter
=
{
'portal_type'
:
'Data Acquisition Unit'
})
\
if
related_data_acquisition_unit
.
getReference
().
startswith
(
ors
_tag_prefix
)
if
related_data_acquisition_unit
.
getReference
().
startswith
(
fluentbit
_tag_prefix
)
]
]
destination_project
=
None
destination_project
=
None
if
related_data_acquisition_unit_list
:
if
related_data_acquisition_unit_list
:
...
@@ -55,7 +55,7 @@ if related_data_acquisition_unit_list:
...
@@ -55,7 +55,7 @@ if related_data_acquisition_unit_list:
data_acquisition_unit
=
portal
.
data_acquisition_unit_module
.
newContent
(
data_acquisition_unit
=
portal
.
data_acquisition_unit_module
.
newContent
(
portal_type
=
'Data Acquisition Unit'
,
portal_type
=
'Data Acquisition Unit'
,
reference
=
ors
_tag
reference
=
fluentbit
_tag
)
)
data_acquisition_unit
.
validate
()
data_acquisition_unit
.
validate
()
data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
...
...
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.xml
View file @
c53925b1
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
ors
_tag
</string>
</value>
<value>
<string>
fluentbit
_tag
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
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