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
304c91b3
Commit
304c91b3
authored
Jul 07, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix variable name according to your context
parent
feae0415
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
27 deletions
+26
-27
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/HostingSubscription_getInstancePackingListLine.xml
...cripts/HostingSubscription_getInstancePackingListLine.xml
+3
-3
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_checkConsistency.xml
...rface_workflow/scripts/SlaveInstance_checkConsistency.xml
+2
-2
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_createSalePackingList.xml
..._workflow/scripts/SlaveInstance_createSalePackingList.xml
+2
-2
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstanceHostingPackingListLine.xml
...ripts/SlaveInstance_getInstanceHostingPackingListLine.xml
+1
-1
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstancePackingListLine.xml
...flow/scripts/SlaveInstance_getInstancePackingListLine.xml
+4
-5
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstanceSetupPackingListLine.xml
...scripts/SlaveInstance_getInstanceSetupPackingListLine.xml
+1
-1
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_requestComputerPartition.xml
...rkflow/scripts/SlaveInstance_requestComputerPartition.xml
+8
-8
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_requestStart.xml
...interface_workflow/scripts/SlaveInstance_requestStart.xml
+4
-4
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
No files found.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/HostingSubscription_getInstancePackingListLine.xml
View file @
304c91b3
...
...
@@ -50,10 +50,10 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
hosting_subscription_uid = state_change.kwargs[\'hosting_subscription_uid\']\n
hosting_subscription = s
oftwar
e_instance.portal_catalog.getResultValue(uid=hosting_subscription_uid)\n
portal = s
oftwar
e_instance.getPortalObject()\n
hosting_subscription = s
lav
e_instance.portal_catalog.getResultValue(uid=hosting_subscription_uid)\n
portal = s
lav
e_instance.getPortalObject()\n
\n
# Get services\n
portal_preferences = portal.portal_preferences\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_checkConsistency.xml
View file @
304c91b3
...
...
@@ -50,8 +50,8 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
s
oftwar
e_instance.Base_checkConsistency()\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
s
lav
e_instance.Base_checkConsistency()\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_createSalePackingList.xml
View file @
304c91b3
...
...
@@ -50,11 +50,11 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
instance_setup_sale_packing_list_line = \\\n
context.SlaveInstance_getInstancePackingListLine(\n
state_change, \n
service_relative_url=s
oftwar
e_instance.portal_preferences.\\\n
service_relative_url=s
lav
e_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource())\n
instance_setup_sale_packing_list = instance_setup_sale_packing_list_line.getParentValue()\n
portal = context.getPortalObject()\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstanceHostingPackingListLine.xml
View file @
304c91b3
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
return context.SlaveInstance_getInstancePackingListLine(\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstancePackingListLine.xml
View file @
304c91b3
...
...
@@ -50,9 +50,9 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
\n
portal = s
oftwar
e_instance.getPortalObject()\n
portal = s
lav
e_instance.getPortalObject()\n
\n
# Get services\n
portal_preferences = portal.portal_preferences\n
...
...
@@ -79,15 +79,14 @@ state_list.extend(portal.getPortalCurrentInventoryStateList())\n
packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List Line\',\n
simulation_state=state_list,\n
aggregate_uid=s
oftwar
e_instance.getUid(),\n
aggregate_uid=s
lav
e_instance.getUid(),\n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
limit=1,\n
)\n
\n
if packing_list_line is None:\n
raise ValueError("No sale packing list line found for %s" % \\\n
software_instance.getRelativeUrl())\n
raise ValueError("No sale packing list line found for %s - %s" % (slave_instance.getRelativeUrl(),slave_instance.getPortalType()))\n
else:\n
return packing_list_line\n
</string>
</value>
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_getInstanceSetupPackingListLine.xml
View file @
304c91b3
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
s
oftwar
e_instance = state_change[\'object\']\n
<value>
<string>
s
lav
e_instance = state_change[\'object\']\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n
return context.SlaveInstance_getInstancePackingListLine(\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_requestComputerPartition.xml
View file @
304c91b3
...
...
@@ -55,7 +55,7 @@
from DateTime import DateTime\n
import random\n
\n
s
oftwar
e_instance = state_change[\'object\']\n
s
lav
e_instance = state_change[\'object\']\n
software_release_url_string = state_change.kwargs[\'software_release\']\n
hosting_subscription_uid = state_change.kwargs[\'hosting_subscription_uid\']\n
shared = state_change.kwargs[\'shared\']\n
...
...
@@ -64,9 +64,9 @@ tag = state_change.kwargs[\'tag\']\n
filter_kw = state_change.kwargs["filter_kw"]\n
\n
# Assertion: No packing list line should be related to this software instance\n
packing_list_line = s
oftwar
e_instance.getAggregateRelatedValue(portal_type=\'Sale Packing List Line\')\n
packing_list_line = s
lav
e_instance.getAggregateRelatedValue(portal_type=\'Sale Packing List Line\')\n
if packing_list_line is not None:\n
raise ValueError("Software Instance %s is already associated to a packing list line" % s
oftwar
e_instance.getRelativeurl())\n
raise ValueError("Software Instance %s is already associated to a packing list line" % s
lav
e_instance.getRelativeurl())\n
\n
# Find a free computer partition. This means:\n
# Computer Partition which doesn\'t have non delivered sale packing list related\n
...
...
@@ -83,16 +83,16 @@ if "computer_guid" in filter_kw:\n
query_kw["parent_reference"] = filter_kw["computer_guid"]\n
\n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n
isTransitionPossible = s
oftwar
e_instance.getPortalObject().portal_workflow.isTransitionPossible\n
isTransitionPossible = s
lav
e_instance.getPortalObject().portal_workflow.isTransitionPossible\n
query_kw.update(free_for_request=1) # is free\n
result_count = s
oftwar
e_instance.portal_catalog.countResults(**query_kw)[0][0]\n
result_count = s
lav
e_instance.portal_catalog.countResults(**query_kw)[0][0]\n
offset = max(0, result_count-1)\n
if offset >
= SQL_WINDOW_SIZE:\n
limit = (random.randint(0, offset), SQL_WINDOW_SIZE)\n
else:\n
limit = (0, SQL_WINDOW_SIZE)\n
\n
for computer_partition_candidate in s
oftwar
e_instance.portal_catalog(\n
for computer_partition_candidate in s
lav
e_instance.portal_catalog(\n
limit=limit, **query_kw):\n
computer_partition_candidate = computer_partition_candidate.getObject()\n
# Check if the computer partition can be marked as busy (done by an interaction workflow on sale packing list level)\n
...
...
@@ -112,7 +112,7 @@ software_release_document = context.portal_catalog.getResultValue(\n
# protect computer partition from being selected again\n
portal = context.getPortalObject()\n
\n
hosting_subscription = s
oftwar
e_instance.portal_catalog.getResultValue(uid=hosting_subscription_uid)\n
hosting_subscription = s
lav
e_instance.portal_catalog.getResultValue(uid=hosting_subscription_uid)\n
sale_packing_list_line = context.HostingSubscription_getInstancePackingListLine(state_change)\n
base_sale_packing_list = sale_packing_list_line.getParentValue()\n
# XXX: SlaveInstance_createSalePackingList shall be used to create new Sale Packing List\n
...
...
@@ -135,7 +135,7 @@ sale_packing_list = sale_packing_list_module.newContent(\n
sale_packing_list_line = sale_packing_list.newContent(\n
portal_type=\'Sale Packing List Line\',\n
resource=context.portal_preferences.getPreferredInstanceSetupResource(),\n
aggregate_value_list=[s
oftwar
e_instance, software_release_document, computer_partition, hosting_subscription]\n
aggregate_value_list=[s
lav
e_instance, software_release_document, computer_partition, hosting_subscription]\n
)\n
\n
# confirm Sale Packing List\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_requestStart.xml
View file @
304c91b3
...
...
@@ -52,8 +52,8 @@
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
s
oftwar
e_instance = state_change[\'object\']\n
service_relative_url = s
oftwar
e_instance.portal_preferences.\\\n
s
lav
e_instance = state_change[\'object\']\n
service_relative_url = s
lav
e_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
need_to_create_packing_list = False\n
try:\n
...
...
@@ -75,11 +75,11 @@ else:\n
\n
portal = context.getPortalObject()\n
if need_to_create_packing_list:\n
tag = "%s_startInProgress" % s
oftwar
e_instance.getUid()\n
tag = "%s_startInProgress" % s
lav
e_instance.getUid()\n
if (portal.portal_activities.countMessageWithTag(tag) >
0):\n
raise ValueError("Slave Instance is currently being started.")\n
# lock software instance in transaction\n
s
oftwar
e_instance.serialize()\n
s
lav
e_instance.serialize()\n
sale_packing_list = context.SlaveInstance_createSalePackingList(state_change, service_relative_url, tag)\n
sale_packing_list.confirm(activate_kw={\'tag\':tag})\n
...
...
master/bt5/vifib_base/bt/revision
View file @
304c91b3
249
\ No newline at end of file
250
\ No newline at end of file
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