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
Lisa Casino
slapos.core
Commits
8c488f2a
Commit
8c488f2a
authored
Aug 18, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The slave instance must not be allocated when a software instance will be destroyed
parent
6d89d258
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/slave_instance_slap_interface_workflow/scripts/SlaveInstance_requestComputerPartition.xml
...rkflow/scripts/SlaveInstance_requestComputerPartition.xml
+22
-6
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/SlaveInstance_requestComputerPartition.xml
View file @
8c488f2a
...
@@ -57,14 +57,31 @@ portal = context.getPortalObject()\n
...
@@ -57,14 +57,31 @@ portal = context.getPortalObject()\n
def checkSoftwareInstanceIsInstalledOnComputerPartition(software_release,\n
def checkSoftwareInstanceIsInstalledOnComputerPartition(software_release,\n
computer_partition):\n
computer_partition):\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceSetupResource(),\n
portal.portal_preferences.getPreferredInstanceHostingResource(),\n
)\n
query = ComplexQuery(Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
query = ComplexQuery(Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
operator="AND",\n
operator="AND",\n
)\n
)\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\', aggregate_relative_url=query)\n
portal_type=\'Sale Packing List Line\',\n
if sale_packing_list_line is not None:\n
query=query,\n
return True\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
\n
if len(sale_packing_list_line_list) == 1:\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceCleanupResource(),\n
)\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\',\n
query=query,\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
if len(sale_packing_list_line_list) == 0:\n
return True\n
return False\n
return False\n
\n
\n
from DateTime import DateTime\n
from DateTime import DateTime\n
...
@@ -95,7 +112,7 @@ computer_partition = None\n
...
@@ -95,7 +112,7 @@ computer_partition = None\n
query_kw = {\n
query_kw = {\n
\'software_release_url\': software_release_url_string,\n
\'software_release_url\': software_release_url_string,\n
\'portal_type\': \'Computer Partition\',\n
\'portal_type\': \'Computer Partition\',\n
\'free_for_request\' : 0\n
\'free_for_request\' : 0
,
\n
}\n
}\n
# support SLA\n
# support SLA\n
if "computer_guid" in filter_kw:\n
if "computer_guid" in filter_kw:\n
...
@@ -105,7 +122,6 @@ if "computer_guid" in filter_kw:\n
...
@@ -105,7 +122,6 @@ if "computer_guid" in filter_kw:\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
\n
\n
result_count = slave_instance.portal_catalog.countResults(**query_kw)[0][0]\n
result_count = slave_instance.portal_catalog.countResults(**query_kw)[0][0]\n
offset = max(0, result_count-1)\n
offset = max(0, result_count-1)\n
\n
\n
...
...
master/bt5/vifib_base/bt/revision
View file @
8c488f2a
269
270
\ No newline at end of file
\ 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