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
Cédric Le Ninivin
slapos.core
Commits
6d683717
Commit
6d683717
authored
Sep 26, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format: switch link_local with global var
parent
e8c3cd5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
slapos/format.py
slapos/format.py
+3
-2
No files found.
slapos/format.py
View file @
6d683717
...
@@ -56,6 +56,7 @@ from slapos.util import chownDirectory
...
@@ -56,6 +56,7 @@ from slapos.util import chownDirectory
from
slapos.util
import
mkdir_p
from
slapos.util
import
mkdir_p
import
slapos.slap
as
slap
import
slapos.slap
as
slap
LINK_LOCAL
=
True
def
prettify_xml
(
xml
):
def
prettify_xml
(
xml
):
root
=
lxml
.
etree
.
fromstring
(
xml
)
root
=
lxml
.
etree
.
fromstring
(
xml
)
...
@@ -137,7 +138,7 @@ def callAndRead(argument_list, raise_on_error=True):
...
@@ -137,7 +138,7 @@ def callAndRead(argument_list, raise_on_error=True):
def
isGlobalScopeAddress
(
a
):
def
isGlobalScopeAddress
(
a
):
"""Returns True if a is global scope IP v4/6 address"""
"""Returns True if a is global scope IP v4/6 address"""
ip
=
netaddr
.
IPAddress
(
a
)
ip
=
netaddr
.
IPAddress
(
a
)
if
sys
.
platform
==
'cygwin'
:
if
sys
.
platform
==
'cygwin'
and
LINK_LOCAL
:
scope
=
ip
.
is_link_local
()
scope
=
ip
.
is_link_local
()
else
:
else
:
scope
=
not
ip
.
is_link_local
()
scope
=
not
ip
.
is_link_local
()
...
@@ -907,7 +908,7 @@ class Interface(object):
...
@@ -907,7 +908,7 @@ class Interface(object):
an address with.
an address with.
"""
"""
# Getting one address of the interface as base of the next addresses
# Getting one address of the interface as base of the next addresses
if
sys
.
platform
==
'cygwin'
and
addr
and
addr
.
startswith
(
'fe80:'
):
if
sys
.
platform
==
'cygwin'
and
addr
and
addr
.
startswith
(
'fe80:'
)
and
LINK_LOCAL
:
# link-local addresses are added by linux/windows
# link-local addresses are added by linux/windows
return
{
'addr'
:
addr
,
'netmask'
:
netmask
}
return
{
'addr'
:
addr
,
'netmask'
:
netmask
}
if
self
.
ipv6_interface
:
if
self
.
ipv6_interface
:
...
...
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