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
Ivan Tyagov
slapos.core
Commits
b2b6f958
Commit
b2b6f958
authored
Sep 18, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix system account creation for OS such as Mandriva 2010 where --system'' is not supported.
parent
e020a719
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
slapos/format.py
slapos/format.py
+1
-1
slapos/tests/slapformat.py
slapos/tests/slapformat.py
+9
-9
No files found.
slapos/format.py
View file @
b2b6f958
...
@@ -472,7 +472,7 @@ class User(object):
...
@@ -472,7 +472,7 @@ class User(object):
try
:
try
:
pwd
.
getpwnam
(
self
.
name
)
pwd
.
getpwnam
(
self
.
name
)
except
KeyError
:
except
KeyError
:
user_parameter_list
.
append
(
'-
-system
'
)
user_parameter_list
.
append
(
'-
r
'
)
callAndRead
([
'useradd'
]
+
user_parameter_list
)
callAndRead
([
'useradd'
]
+
user_parameter_list
)
else
:
else
:
callAndRead
([
'usermod'
]
+
user_parameter_list
)
callAndRead
([
'usermod'
]
+
user_parameter_list
)
...
...
slapos/tests/slapformat.py
View file @
b2b6f958
...
@@ -225,7 +225,7 @@ class TestComputer(SlapformatMixin):
...
@@ -225,7 +225,7 @@ class TestComputer(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
'ip addr list bridge'
,
'ip addr list bridge'
,
'groupadd slapsoft'
,
'groupadd slapsoft'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
-system
'
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
r
'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
@@ -259,7 +259,7 @@ class TestComputer(SlapformatMixin):
...
@@ -259,7 +259,7 @@ class TestComputer(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
'ip addr list bridge'
,
'ip addr list bridge'
,
'groupadd slapsoft'
,
'groupadd slapsoft'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
-system
'
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
r
'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
@@ -309,9 +309,9 @@ class TestComputer(SlapformatMixin):
...
@@ -309,9 +309,9 @@ class TestComputer(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
'ip addr list bridge'
,
'ip addr list bridge'
,
'groupadd slapsoft'
,
'groupadd slapsoft'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
-system
'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
r
'
,
'groupadd testuser'
,
'groupadd testuser'
,
'useradd -d /instance_root/partition -g testuser -s /bin/false -G slapsoft testuser -
-system
'
,
'useradd -d /instance_root/partition -g testuser -s /bin/false -G slapsoft testuser -
r
'
,
'tunctl -t tap -u testuser'
,
'tunctl -t tap -u testuser'
,
'ip link set tap up'
,
'ip link set tap up'
,
'brctl show'
,
'brctl show'
,
...
@@ -391,9 +391,9 @@ class TestComputer(SlapformatMixin):
...
@@ -391,9 +391,9 @@ class TestComputer(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
# 'ip addr list bridge',
# 'ip addr list bridge',
'groupadd slapsoft'
,
'groupadd slapsoft'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
-system
'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -
r
'
,
'groupadd testuser'
,
'groupadd testuser'
,
'useradd -d /instance_root/partition -g testuser -s /bin/false -G slapsoft testuser -
-system
'
,
'useradd -d /instance_root/partition -g testuser -s /bin/false -G slapsoft testuser -
r
'
,
# 'ip addr add ip/255.255.255.255 dev bridge',
# 'ip addr add ip/255.255.255.255 dev bridge',
# 'ip addr list bridge',
# 'ip addr list bridge',
# 'ip addr add ip/ffff:ffff:ffff:ffff:: dev bridge',
# 'ip addr add ip/ffff:ffff:ffff:ffff:: dev bridge',
...
@@ -469,7 +469,7 @@ class TestUser(SlapformatMixin):
...
@@ -469,7 +469,7 @@ class TestUser(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
'groupadd doesnotexistsyet'
,
'groupadd doesnotexistsyet'
,
'useradd -d /doesnotexistsyet -g doesnotexistsyet -s /bin/false '
\
'useradd -d /doesnotexistsyet -g doesnotexistsyet -s /bin/false '
\
'doesnotexistsyet -
-system
'
'doesnotexistsyet -
r
'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
@@ -482,7 +482,7 @@ class TestUser(SlapformatMixin):
...
@@ -482,7 +482,7 @@ class TestUser(SlapformatMixin):
self
.
assertEqual
([
self
.
assertEqual
([
'groupadd doesnotexistsyet'
,
'groupadd doesnotexistsyet'
,
'useradd -d /doesnotexistsyet -g doesnotexistsyet -s /bin/false -G '
\
'useradd -d /doesnotexistsyet -g doesnotexistsyet -s /bin/false -G '
\
'additionalgroup1,additionalgroup2 doesnotexistsyet -
-system
'
'additionalgroup1,additionalgroup2 doesnotexistsyet -
r
'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
@@ -494,7 +494,7 @@ class TestUser(SlapformatMixin):
...
@@ -494,7 +494,7 @@ class TestUser(SlapformatMixin):
user
.
create
()
user
.
create
()
self
.
assertEqual
([
self
.
assertEqual
([
'useradd -d /testuser -g testuser -s /bin/false testuser -
-system
'
'useradd -d /testuser -g testuser -s /bin/false testuser -
r
'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
...
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