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
Léo-Paul Géneau
slapos.core
Commits
e1d36374
Commit
e1d36374
authored
Aug 21, 2014
by
Cédric de Saint Martin
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
f1d6f0fc
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 @
e1d36374
...
...
@@ -296,6 +296,7 @@ def loadComputerConfigurationFromXML():
for
address
in
partition
[
'address_list'
]:
address
[
'reference'
]
=
partition
[
'tap'
][
'name'
]
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
)
return
'done'
...
...
slapos/tests/slapproxy/__init__.py
View file @
e1d36374
...
...
@@ -124,7 +124,11 @@ database_uri = %(tempdir)s/lib/proxy.db
for
i
in
range
(
partition_amount
):
partition_example
=
{
'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
)
...
...
@@ -132,8 +136,9 @@ database_uri = %(tempdir)s/lib/proxy.db
'computer_id'
:
self
.
computer_id
,
'xml'
:
xml_marshaller
.
xml_marshaller
.
dumps
(
computer_dict
),
}
self
.
app
.
post
(
'/loadComputerConfigurationFromXML'
,
rv
=
self
.
app
.
post
(
'/loadComputerConfigurationFromXML'
,
data
=
request_dict
)
self
.
assertEqual
(
rv
.
_status_code
,
200
)
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