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
18
Merge Requests
18
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
nexedi
slapos.core
Commits
cb05023a
Commit
cb05023a
authored
Apr 11, 2019
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "format: Support environments with netmask with /"
This reverts commit
18ee7dad
parent
cdee9d29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
slapos/format.py
slapos/format.py
+3
-8
slapos/tests/test_slapformat.py
slapos/tests/test_slapformat.py
+7
-7
No files found.
slapos/format.py
View file @
cb05023a
...
...
@@ -1212,11 +1212,6 @@ class Interface(object):
raise
AddressGenerationError
(
addr
)
netmask
=
ipv6FromBin
(
'1'
*
128
)
# the netmask of the tap itself is always 128 bits
if
'/'
in
netmask
:
_addr_netmask
,
_
=
netmask
.
split
(
'/'
)
else
:
_addr_netmask
=
netmask
while
try_num
>
0
:
if
tap
:
addr
=
ipv6FromBin
(
prefix
...
...
@@ -1226,11 +1221,11 @@ class Interface(object):
addr
=
':'
.
join
(
address_dict
[
'addr'
].
split
(
':'
)[:
-
1
]
+
[
'%x'
%
(
random
.
randint
(
1
,
65000
),
)])
socket
.
inet_pton
(
socket
.
AF_INET6
,
addr
)
if
(
dict
(
addr
=
addr
,
netmask
=
_addr_
netmask
)
not
in
if
(
dict
(
addr
=
addr
,
netmask
=
netmask
)
not
in
self
.
getGlobalScopeAddressList
(
tap
=
tap
)):
# Checking the validity of the IPv6 address
if
self
.
_addSystemAddress
(
addr
,
_addr_
netmask
,
tap
=
tap
):
return
dict
(
addr
=
addr
,
netmask
=
_addr_
netmask
)
if
self
.
_addSystemAddress
(
addr
,
netmask
,
tap
=
tap
):
return
dict
(
addr
=
addr
,
netmask
=
netmask
)
try_num
-=
1
raise
AddressGenerationError
(
addr
)
...
...
slapos/tests/test_slapformat.py
View file @
cb05023a
...
...
@@ -471,11 +471,11 @@ class TestComputer(SlapformatMixin):
INTERFACE_DICT
[
'myinterface'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'192.168.242.77'
,
'broadcast'
:
'127.0.0.1'
,
'netmask'
:
'255.255.255.0'
}],
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::
/64
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
INTERFACE_DICT
[
'tap'
]
=
{
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::
/64
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
computer
.
format
(
alter_user
=
False
)
...
...
@@ -524,7 +524,7 @@ class TestComputer(SlapformatMixin):
INTERFACE_DICT
[
'iface'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'192.168.242.77'
,
'broadcast'
:
'127.0.0.1'
,
'netmask'
:
'255.255.255.0'
}],
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27:3456:1357::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff:ffff::
/48
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27:3456:1357::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff:ffff::'
}]
}
INTERFACE_DICT
[
'eth1'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'10.8.0.1'
,
'broadcast'
:
'10.8.0.254'
,
...
...
@@ -532,7 +532,7 @@ class TestComputer(SlapformatMixin):
}
INTERFACE_DICT
[
'tap'
]
=
{
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27:3456:1357:7890:ffff:ffff'
,
'netmask'
:
'ffff:ffff:ffff:ffff:ffff:ffff:ffff
/16
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27:3456:1357:7890:ffff:ffff'
,
'netmask'
:
'ffff:ffff:ffff:ffff:ffff:ffff:ffff'
}]
}
computer
.
format
(
alter_user
=
False
)
...
...
@@ -623,7 +623,7 @@ class TestComputer(SlapformatMixin):
INTERFACE_DICT
[
'myinterface'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'192.168.242.77'
,
'broadcast'
:
'127.0.0.1'
,
'netmask'
:
'255.255.255.0'
}],
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::
/64
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
computer
.
format
(
alter_network
=
False
,
alter_user
=
False
)
...
...
@@ -663,7 +663,7 @@ class TestComputer(SlapformatMixin):
INTERFACE_DICT
[
'myinterface'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'192.168.242.77'
,
'broadcast'
:
'127.0.0.1'
,
'netmask'
:
'255.255.255.0'
}],
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::
/64
'
}]
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
computer
.
format
(
use_unique_local_address_block
=
True
,
alter_user
=
False
,
create_tap
=
False
)
...
...
@@ -725,7 +725,7 @@ class TestComputerWithCPUSet(SlapformatMixin):
socket
.
AF_INET
:
[
{
'addr'
:
'127.0.0.1'
,
'broadcast'
:
'127.0.255.255'
,
'netmask'
:
'255.255.0.0'
}],
socket
.
AF_INET6
:
[
{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::
/64
'
}]
{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
from
slapos.manager.cpuset
import
Manager
...
...
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