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
80ab4e0f
Commit
80ab4e0f
authored
Aug 21, 2014
by
Cédric de Saint Martin
Committed by
Rafael Monnerat
Nov 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapproxy: give computer reference to partition network.
Also make sure we test adding addresses to partitions.
parent
d1e40c8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
slapos/proxy/views.py
slapos/proxy/views.py
+1
-0
slapos/tests/slapproxy/__init__.py
slapos/tests/slapproxy/__init__.py
+7
-2
No files found.
slapos/proxy/views.py
View file @
80ab4e0f
...
@@ -296,6 +296,7 @@ def loadComputerConfigurationFromXML():
...
@@ -296,6 +296,7 @@ def loadComputerConfigurationFromXML():
for
address
in
partition
[
'address_list'
]:
for
address
in
partition
[
'address_list'
]:
address
[
'reference'
]
=
partition
[
'tap'
][
'name'
]
address
[
'reference'
]
=
partition
[
'tap'
][
'name'
]
address
[
'partition_reference'
]
=
partition
[
'reference'
]
address
[
'partition_reference'
]
=
partition
[
'reference'
]
address
[
'computer_reference'
]
=
partition
[
'computer_reference'
]
execute_db
(
'partition_network'
,
'INSERT OR REPLACE INTO %s (reference, partition_reference, computer_reference, address, netmask) values(:reference, :partition_reference, :computer_reference, :addr, :netmask)'
,
address
)
execute_db
(
'partition_network'
,
'INSERT OR REPLACE INTO %s (reference, partition_reference, computer_reference, address, netmask) values(:reference, :partition_reference, :computer_reference, :addr, :netmask)'
,
address
)
return
'done'
return
'done'
...
...
slapos/tests/slapproxy/__init__.py
View file @
80ab4e0f
...
@@ -124,7 +124,11 @@ database_uri = %(tempdir)s/lib/proxy.db
...
@@ -124,7 +124,11 @@ database_uri = %(tempdir)s/lib/proxy.db
for
i
in
range
(
partition_amount
):
for
i
in
range
(
partition_amount
):
partition_example
=
{
partition_example
=
{
'reference'
:
'slappart%s'
%
i
,
'reference'
:
'slappart%s'
%
i
,
'address_list'
:
[],
'address_list'
:
[
{
'addr'
:
'1.2.3.4'
,
'netmask'
:
'255.255.255.255'
},
{
'addr'
:
'4.3.2.1'
,
'netmask'
:
'255.255.255.255'
}
],
'tap'
:
{
'name'
:
'tap0'
},
}
}
computer_dict
[
'partition_list'
].
append
(
partition_example
)
computer_dict
[
'partition_list'
].
append
(
partition_example
)
...
@@ -132,8 +136,9 @@ database_uri = %(tempdir)s/lib/proxy.db
...
@@ -132,8 +136,9 @@ database_uri = %(tempdir)s/lib/proxy.db
'computer_id'
:
self
.
computer_id
,
'computer_id'
:
self
.
computer_id
,
'xml'
:
xml_marshaller
.
xml_marshaller
.
dumps
(
computer_dict
),
'xml'
:
xml_marshaller
.
xml_marshaller
.
dumps
(
computer_dict
),
}
}
self
.
app
.
post
(
'/loadComputerConfigurationFromXML'
,
rv
=
self
.
app
.
post
(
'/loadComputerConfigurationFromXML'
,
data
=
request_dict
)
data
=
request_dict
)
self
.
assertEqual
(
rv
.
_status_code
,
200
)
def
tearDown
(
self
):
def
tearDown
(
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