Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Romain Courteaud
slapos.core
Commits
6362259e
Commit
6362259e
authored
Jan 27, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Computer Network creation requires a project reference
parent
f77ba5b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestNetwork.py
...n_slap_interface_workflow/script_Person_requestNetwork.py
+16
-3
No files found.
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestNetwork.py
View file @
6362259e
...
...
@@ -8,20 +8,32 @@ kwargs = state_change.kwargs
try
:
computer_network_title
=
kwargs
[
'network_title'
]
except
KeyError
:
raise
TypeError
,
"Person_requestNetwork takes exactly
1 argument
"
raise
TypeError
,
"Person_requestNetwork takes exactly
2 arguments. Missing network_title.
"
tag
=
"%s_%s_NetworkInProgress"
%
(
person
.
getUid
(),
try
:
project_reference
=
kwargs
[
'project_reference'
]
except
KeyError
:
raise
TypeError
,
"Person_requestNetwork takes exactly 2 arguments. Missing project_reference."
tag
=
"%s_%s_NetworkInProgress"
%
(
person
.
getUid
(),
computer_network_title
)
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise
NotImplementedError
(
tag
)
# Ensure project is correctly set
project_list
=
portal
.
portal_catalog
.
portal_catalog
(
portal_type
=
'Project'
,
reference
=
project_reference
,
validation_state
=
'validated'
,
limit
=
2
)
if
len
(
project_list
)
!=
1
:
raise
NotImplementedError
(
"%i projects '%s'"
%
(
len
(
project_list
),
project_reference
))
computer_network_portal_type
=
"Computer Network"
computer_network_list
=
portal
.
portal_catalog
.
portal_catalog
(
portal_type
=
computer_network_portal_type
,
title
=
computer_network_title
,
validation_state
=
"validated"
,
follow_up__uid
=
project_list
[
0
].
getUid
(),
#validation_state="validated",
limit
=
2
)
if
len
(
computer_network_list
)
==
2
:
...
...
@@ -35,6 +47,7 @@ else:
portal_type
=
computer_network_portal_type
,
title
=
computer_network_title
,
source_administration
=
person
.
getRelativeUrl
(),
follow_up_value
=
project_list
[
0
],
activate_kw
=
{
'tag'
:
tag
}
)
context
.
REQUEST
.
set
(
"computer_network_relative_url"
,
computer_network
.
getRelativeUrl
())
...
...
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