Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
9d0e91b1
Commit
9d0e91b1
authored
Nov 08, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support repeated software instance title.
parent
0ed82865
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
...rface_workflow/scripts/Person_requestSoftwareInstance.xml
+14
-2
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+15
-3
No files found.
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
View file @
9d0e91b1
...
...
@@ -78,10 +78,22 @@ tag = "%s_%s_inProgress" % (person.getUid(), \n
software_title)\n
\n
# Check if it already exists\n
request_software_instance = portal.portal_catalog.getResultValue(\n
cleanup_resource = portal.portal_preferences.getPreferredInstanceCleanupResource()\n
request_software_instance = None\n
for si in portal.portal_catalog(\n
portal_type=software_instance_portal_type,\n
title=software_title,\n
)\n
):\n
try:\n
cleanup_delivery_line = si.Item_getInstancePackingListLine(cleanup_resource)\n
except ValueError:\n
request_software_instance = si\n
break\n
else:\n
if cleanup_delivery_line.getSimulationState() != \'destroyed\':\n
request_software_instance = si\n
break\n
\n
if (request_software_instance is None):\n
hosting_subscription_reference = "HOSTSUBS-%s" % context.getPortalObject().portal_ids\\\n
.generateNewId(id_group=\'slap_hosting_subscription_reference\', id_generator=\'uid\')\n
...
...
master/bt5/vifib_slap/bt/revision
View file @
9d0e91b1
441
\ No newline at end of file
442
\ No newline at end of file
master/product/Vifib/Tool/SlapTool.py
View file @
9d0e91b1
...
...
@@ -745,6 +745,8 @@ class SlapTool(BaseTool):
else
:
instance_portal_type
=
"Software Instance"
cleanup_resource
=
self
.
getPortalObject
().
portal_preferences
\
.
getPreferredInstanceCleanupResource
()
if
computer_id
and
computer_partition_id
:
# requested by Software Instance, there is already top part of tree
software_instance_document
=
self
.
\
...
...
@@ -781,15 +783,25 @@ class SlapTool(BaseTool):
instance_xml
=
instance_xml
,
sla_xml
=
sla_xml
,
state
=
state
)
requested_software_instance
=
person
.
portal_catalog
.
\
getResultValue
(
requested_software_instance
=
None
for
software_instance
in
person
.
portal_catalog
(
portal_type
=
instance_portal_type
,
# In order be in sync with defaults of person.
# requestSoftwareInstance it is required to default here
# too
source_reference
=
software_type
or
'RootSoftwareInstance'
,
title
=
partition_reference
,
)
):
try
:
cleanup_delivery_line
=
software_instance
\
.
Item_getInstancePackingListLine
(
cleanup_resource
)
except
ValueError
:
requested_software_instance
=
software_instance
break
else
:
if
cleanup_delivery_line
.
getSimulationState
()
!=
'delivered'
:
requested_software_instance
=
software_instance
break
if
requested_software_instance
is
None
:
raise
SoftwareInstanceNotReady
...
...
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