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
e0520cea
Commit
e0520cea
authored
Apr 12, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/cygwin'
parents
67c9b585
30a3eec6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
slapos/format.py
slapos/format.py
+10
-5
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+1
-1
slapos/grid/utils.py
slapos/grid/utils.py
+2
-0
No files found.
slapos/format.py
View file @
e0520cea
...
...
@@ -539,10 +539,11 @@ class User(object):
# XXX: This method shall be no-op in case if all is correctly setup
# This method shall check if all is correctly done
# This method shall not reset groups, just add them
grpname
=
'grp_'
+
self
.
name
if
sys
.
platform
==
'cygwin'
else
self
.
name
try
:
grp
.
getgrnam
(
self
.
name
)
grp
.
getgrnam
(
grp
name
)
except
KeyError
:
callAndRead
([
'groupadd'
,
self
.
name
])
callAndRead
([
'groupadd'
,
grp
name
])
user_parameter_list
=
[
'-d'
,
self
.
path
,
'-g'
,
self
.
name
,
'-s'
,
'/bin/false'
]
...
...
@@ -713,6 +714,9 @@ class Interface(object):
except
KeyError
:
raise
ValueError
(
"%s must have at least one IPv6 address assigned"
%
\
interface_name
)
if
sys
.
platform
==
'cygwin'
:
for
q
in
address_list
:
q
.
setdefault
(
'netmask'
,
'FFFF:FFFF:FFFF:FFFF::'
)
# XXX: Missing implementation of Unique Local IPv6 Unicast Addresses as
# defined in http://www.rfc-editor.org/rfc/rfc4193.txt
# XXX: XXX: XXX: IT IS DISALLOWED TO IMPLEMENT link-local addresses as
...
...
@@ -797,7 +801,7 @@ class Interface(object):
return
True
# check existence on interface for ipv6
_
,
result
=
callAndRead
([
'ip'
,
'addr'
,
'list'
,
interface_name
])
_
,
result
=
callAndRead
([
'ip'
,
'
-6'
,
'
addr'
,
'list'
,
interface_name
])
for
l
in
result
.
split
(
'
\
n
'
):
if
address
in
l
:
if
'tentative'
in
l
:
...
...
@@ -827,7 +831,8 @@ class Interface(object):
def
addIPv4LocalAddress
(
self
,
addr
=
None
):
"""Adds local IPv4 address in ipv4_local_network"""
netmask
=
'255.255.255.255'
netmask
=
'255.255.255.254'
if
sys
.
platform
==
'cygwin'
\
else
'255.255.255.255'
local_address_list
=
self
.
getIPv4LocalAddressList
()
if
addr
is
None
:
return
self
.
_generateRandomIPv4Address
(
netmask
)
...
...
@@ -1156,7 +1161,7 @@ class Config(object):
except
ValueError
:
pass
except
OSError
:
missing_binary_list
.
append
(
b
)
missing_binary_list
.
append
(
b
[
0
]
)
if
missing_binary_list
:
raise
UsageError
(
'Some required binaries are missing or not '
'functional: %s'
%
(
','
.
join
(
missing_binary_list
),
))
...
...
slapos/grid/slapgrid.py
View file @
e0520cea
...
...
@@ -680,7 +680,7 @@ class Slapgrid(object):
process_handler
=
subprocess
.
Popen
(
command
,
preexec_fn
=
lambda
:
dropPrivileges
(
uid
,
gid
),
cwd
=
cwd
,
env
=
{},
**
kw
)
env
=
None
if
sys
.
platform
==
'cygwin'
else
{},
**
kw
)
process_handler
.
stdin
.
flush
()
process_handler
.
stdin
.
close
()
process_handler
.
stdin
=
None
...
...
slapos/grid/utils.py
View file @
e0520cea
...
...
@@ -95,6 +95,8 @@ class SlapPopen(subprocess.Popen):
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
kwargs
.
update
(
stdin
=
subprocess
.
PIPE
)
if
sys
.
platform
==
'cygwin'
and
kwargs
.
get
(
'env'
)
==
{}:
kwargs
[
'env'
]
=
None
subprocess
.
Popen
.
__init__
(
self
,
*
args
,
**
kwargs
)
self
.
stdin
.
flush
()
self
.
stdin
.
close
()
...
...
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