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
1
Merge Requests
1
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
9ff9bdc6
Commit
9ff9bdc6
authored
Oct 29, 2024
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin_telecom_base: Improve ERP5Site_registerOrs responses
parent
068abf1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
...ortal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
+18
-4
No files found.
bt5/wendelin_telecom_base/SkinTemplateItem/portal_skins/wendelin_telecom_base/ERP5Site_registerOrs.py
View file @
9ff9bdc6
...
...
@@ -18,15 +18,23 @@ data_acquisition_unit = context.portal_catalog.getResultValue(
validation_state
=
'validated'
)
if
data_acquisition_unit
:
error_msg
=
"ORS with tag %s already exists."
%
fluentbit_tag
response_dict
=
dict
(
error_msg
=
error_msg
)
status
=
"ok"
message
=
"ORS with tag %s already exists."
%
fluentbit_tag
response_dict
=
dict
(
status
=
status
,
message
=
message
)
return
json
.
dumps
(
response_dict
)
# Check if the fluentbit tag has a valid format
fluentbit_tag_components
=
fluentbit_tag
.
split
(
'_'
)
if
len
(
fluentbit_tag_components
)
not
in
[
2
,
3
]:
error_msg
=
"Invalid ORS tag %s found"
%
fluentbit_tag
response_dict
=
dict
(
error_msg
=
error_msg
)
status
=
"error"
message
=
"Invalid ORS tag %s found"
%
fluentbit_tag
response_dict
=
dict
(
status
=
status
,
message
=
message
)
return
json
.
dumps
(
response_dict
)
ors_hostname
,
ors_comp_id
=
fluentbit_tag_components
[
0
],
fluentbit_tag_components
[
1
]
...
...
@@ -62,4 +70,10 @@ data_acquisition_unit.validate()
data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
data_supply
.
setDestinationProject
(
destination_project
)
status
=
"ok"
message
=
"ORS with tag %s successfully registered."
%
fluentbit_tag
response_dict
=
dict
(
status
=
status
,
message
=
message
)
return
json
.
dumps
(
response_dict
)
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