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
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
Nicolas Wavrant
slapos.core
Commits
676f082a
Commit
676f082a
authored
12 years ago
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not create destroyed software instance.
parent
605ee2ea
master
cache
cleanup
cliff-cleanup
cygwin-link-local
fix-slapos-core-tests
format-hardware-info
format_loop
garbage-collect
hosting_daily_invoice
lxc
master-dev
monitoring
proxy-sqlalchemy
rafael
runner-tests
slapgrid-process-management
slapgrid_client_test
slaphateoas
slapos-override-env
slapos.cache.source
slapproxy-connection-parameter
test
1.3.15
1.3.14
1.3.13
1.3.12
1.3.11
1.3.10
1.3.9
1.3.8
1.3.7
1.3.6.3
1.3.6.2
1.3.6.1
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.4.1
1.2.4
1.2.3.1
1.2.3
1.2.2
1.2.1
1.2.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
1.0.0rc6
1.0.0rc5
1.0.0rc4
1.0.0rc3
1.0.0-rc1
0.35.1
0.34
0.33.1
0.33
0.32.3
0.32.2
0.32
0.31.2
0.31.1
0.31
0.30
0.29
0.28.9
0.28.8
0.28.7
0.28.6
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28
0.27
0.26.2
0.26.1
0.26
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
55 deletions
+65
-55
master/bt5/vifib_slapos_core/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.xml
..._interface_workflow/scripts/RequesterInstance_request.xml
+64
-54
master/bt5/vifib_slapos_core/bt/revision
master/bt5/vifib_slapos_core/bt/revision
+1
-1
No files found.
master/bt5/vifib_slapos_core/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.xml
View file @
676f082a
...
...
@@ -122,6 +122,10 @@ else:\n
raise ValueError, "Too many instances \'%s\' found: %s" % (software_title, [x.path for x in request_software_instance_list])\n
\n
if (request_software_instance is None):\n
if (root_state == "destroyed"):\n
instance_found = False\n
else:\n
instance_found = True\n
# First time that the software instance is requested\n
if is_slave == True:\n
software_instance_portal_type = "Slave Instance"\n
...
...
@@ -149,6 +153,7 @@ if (request_software_instance is None):\n
graph[request_software_instance.getUid()] = []\n
\n
else:\n
instance_found = True\n
# Update the predecessor category of the previous requester\n
predecessor = request_software_instance.getPredecessorRelatedValue(portal_type="Software Instance")\n
if (predecessor is None):\n
...
...
@@ -161,41 +166,46 @@ else:\n
predecessor.edit(predecessor_uid_list=predecessor_uid_list)\n
graph[predecessor.getUid()] = predecessor_uid_list\n
\n
# Change desired state\n
promise_kw = {\n
if instance_found:\n
\n
# Change desired state\n
promise_kw = {\n
\'instance_xml\': instance_xml,\n
\'software_type\': software_type,\n
\'sla_xml\': sla_xml,\n
\'software_release\': software_release_url_string,\n
\'shared\': is_slave,\n
}\n
request_software_instance_url = request_software_instance.getRelativeUrl()\n
context.REQUEST.set(\'request_instance\', request_software_instance)\n
if (root_state == "started"):\n
}\n
request_software_instance_url = request_software_instance.getRelativeUrl()\n
context.REQUEST.set(\'request_instance\', request_software_instance)\n
if (root_state == "started"):\n
request_software_instance.requestStart(**promise_kw)\n
elif (root_state == "stopped"):\n
elif (root_state == "stopped"):\n
request_software_instance.requestStop(**promise_kw)\n
elif (root_state == "destroyed"):\n
elif (root_state == "destroyed"):\n
request_software_instance.requestDestroy(**promise_kw)\n
context.REQUEST.set(\'request_instance\', None)\n
else:\n
else:\n
raise ValueError, "state should be started, stopped or destroyed"\n
\n
predecessor_list = requester_instance.getPredecessorList() + [request_software_instance_url]\n
uniq_predecessor_list = list(set(predecessor_list))\n
predecessor_list.sort()\n
uniq_predecessor_list.sort()\n
predecessor_list = requester_instance.getPredecessorList() + [request_software_instance_url]\n
uniq_predecessor_list = list(set(predecessor_list))\n
predecessor_list.sort()\n
uniq_predecessor_list.sort()\n
\n
assert predecessor_list == uniq_predecessor_list, "%s != %s" % (predecessor_list, uniq_predecessor_list)\n
assert predecessor_list == uniq_predecessor_list, "%s != %s" % (predecessor_list, uniq_predecessor_list)\n
\n
# update graph to reflect requested operation\n
graph[requester_instance.getUid()] = requester_instance.getPredecessorUidList() + [request_software_instance.getUid()]\n
# update graph to reflect requested operation\n
graph[requester_instance.getUid()] = requester_instance.getPredecessorUidList() + [request_software_instance.getUid()]\n
\n
# check if all elements are still connected and if there is no cycle\n
request_software_instance.checkConnected(graph, hosting_subscription.getUid())\n
request_software_instance.checkNotCyclic(graph)\n
# check if all elements are still connected and if there is no cycle\n
request_software_instance.checkConnected(graph, hosting_subscription.getUid())\n
request_software_instance.checkNotCyclic(graph)\n
\n
requester_instance.edit(predecessor_list=predecessor_list)\n
requester_instance.edit(predecessor_list=predecessor_list)\n
\n
else:\n
context.REQUEST.set(\'request_instance\', None)\n
]]>
</string>
</value>
...
...
This diff is collapsed.
Click to expand it.
master/bt5/vifib_slapos_core/bt/revision
View file @
676f082a
39
\ No newline at end of file
40
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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