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
Ivan Tyagov
slapos.core
Commits
5df361ef
Commit
5df361ef
authored
Nov 18, 2014
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! slapos.proxy: fix slave requests.
parent
d4a595c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
slapos/proxy/views.py
slapos/proxy/views.py
+1
-0
slapos/tests/slapproxy/__init__.py
slapos/tests/slapproxy/__init__.py
+13
-2
No files found.
slapos/proxy/views.py
View file @
5df361ef
...
...
@@ -640,6 +640,7 @@ def requestSlave(software_release, software_type, partition_reference, partition
q
+=
' AND reference=?'
# instance_guid should be like: %s-%s % (requested_computer_id, partition_id)
# But code is convoluted here, so we check
instance_guid
=
filter_kw
[
'instance_guid'
]
if
instance_guid
.
startswith
(
requested_computer_id
):
a
(
instance_guid
[
len
(
requested_computer_id
)
+
1
:])
else
:
...
...
slapos/tests/slapproxy/__init__.py
View file @
5df361ef
...
...
@@ -567,8 +567,7 @@ class TestSlaveRequest(MasterMixin):
# First request of slave instance
name
=
'MyFirstInstance'
requester
=
'slappart2'
our_slave
=
self
.
request
(
'http://sr//'
,
None
,
name
,
requester
,
shared
=
True
)
our_slave
=
self
.
request
(
'http://sr//'
,
None
,
name
,
requester
,
shared
=
True
)
self
.
assertIsInstance
(
our_slave
,
slapos
.
slap
.
ComputerPartition
)
self
.
assertEqual
(
our_slave
.
_connection_dict
,
{})
# Get updated information for master partition
...
...
@@ -585,6 +584,18 @@ class TestSlaveRequest(MasterMixin):
self
.
assertIsInstance
(
our_slave
,
slapos
.
slap
.
ComputerPartition
)
self
.
assertEqual
(
slave_address
,
our_slave
.
_connection_dict
)
def
test_slave_request_instance_guid
(
self
):
"""
Test that instance_guid support behaves correctly.
Warning: proxy doesn't gives unique id of instance, but gives instead unique id
of partition.
"""
self
.
add_free_partition
(
1
)
partition
=
self
.
request
(
'http://sr//'
,
None
,
'MyInstance'
,
'slappart1'
)
slave
=
self
.
request
(
'http://sr//'
,
None
,
'MySlaveInstance'
,
'slappart1'
,
shared
=
True
,
filter_kw
=
dict
(
instance_guid
=
partition
.
_instance_guid
))
self
.
assertEqual
(
slave
.
_partition_id
,
partition
.
_partition_id
)
class
TestMultiNodeSupport
(
MasterMixin
):
def
test_multi_node_support_different_software_release_list
(
self
):
"""
...
...
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