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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
fbcee845
Commit
fbcee845
authored
Jul 26, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Slave Instance if request comes for a slave.
parent
d0dcbd4d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+15
-5
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
fbcee845
...
@@ -607,6 +607,11 @@ class SlapTool(BaseTool):
...
@@ -607,6 +607,11 @@ class SlapTool(BaseTool):
sla_xml
=
etree
.
tostring
(
instance
,
pretty_print
=
True
,
sla_xml
=
etree
.
tostring
(
instance
,
pretty_print
=
True
,
xml_declaration
=
True
,
encoding
=
'utf-8'
)
xml_declaration
=
True
,
encoding
=
'utf-8'
)
if
slave
:
instance_portal_type
=
"Slave Instance"
else
:
instance_portal_type
=
"Software Instance"
if
computer_id
and
computer_partition_id
:
if
computer_id
and
computer_partition_id
:
# requested by Software Instance, there is already top part of tree
# requested by Software Instance, there is already top part of tree
software_instance_document
=
self
.
\
software_instance_document
=
self
.
\
...
@@ -616,15 +621,15 @@ class SlapTool(BaseTool):
...
@@ -616,15 +621,15 @@ class SlapTool(BaseTool):
software_release
=
software_release
,
software_release
=
software_release
,
software_type
=
software_type
,
software_type
=
software_type
,
partition_reference
=
partition_reference
,
partition_reference
=
partition_reference
,
shared
=
shared
,
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
slave
=
slave
,
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
state
=
state
)
state
=
state
)
# Get requested software instance
# Get requested software instance
requested_software_instance
=
software_instance_document
.
portal_catalog
.
\
requested_software_instance
=
software_instance_document
.
portal_catalog
.
\
getResultValue
(
getResultValue
(
portal_type
=
"Software Instance"
,
portal_type
=
instance_portal_type
,
source_reference
=
software_type
,
source_reference
=
software_type
,
# predecessor_related_uid is inconsistent with
# predecessor_related_uid is inconsistent with
# SoftwareInstancae.requestSoftwareInstance but in this case it
# SoftwareInstancae.requestSoftwareInstance but in this case it
...
@@ -639,13 +644,13 @@ class SlapTool(BaseTool):
...
@@ -639,13 +644,13 @@ class SlapTool(BaseTool):
person
.
requestSoftwareInstance
(
software_release
=
software_release
,
person
.
requestSoftwareInstance
(
software_release
=
software_release
,
software_type
=
software_type
,
software_type
=
software_type
,
software_title
=
partition_reference
,
software_title
=
partition_reference
,
s
hared
=
shared
,
s
lave
=
slave
,
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
state
=
state
)
state
=
state
)
requested_software_instance
=
person
.
portal_catalog
.
\
requested_software_instance
=
person
.
portal_catalog
.
\
getResultValue
(
getResultValue
(
portal_type
=
"Software Instance"
,
portal_type
=
instance_portal_type
,
# In order be in sync with defaults of person.
# In order be in sync with defaults of person.
# requestSoftwareInstance it is required to default here
# requestSoftwareInstance it is required to default here
# too
# too
...
@@ -656,8 +661,13 @@ class SlapTool(BaseTool):
...
@@ -656,8 +661,13 @@ class SlapTool(BaseTool):
if
requested_software_instance
is
None
:
if
requested_software_instance
is
None
:
raise
SoftwareInstanceNotReady
raise
SoftwareInstanceNotReady
else
:
else
:
query_kw
=
{}
if
slave
:
# Provide precise reference when search for a slave.
query_kw
[
'slave_reference'
]
=
requested_software_instance
.
getReference
()
movement
=
self
.
_getSalePackingListLineForComputerPartition
(
movement
=
self
.
_getSalePackingListLineForComputerPartition
(
requested_software_instance
)
requested_software_instance
,
**
query_kw
)
if
movement
is
None
:
if
movement
is
None
:
raise
SoftwareInstanceNotReady
raise
SoftwareInstanceNotReady
software_instance
=
SoftwareInstance
(
software_instance
=
SoftwareInstance
(
...
...
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