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
15771b4b
Commit
15771b4b
authored
Apr 02, 2020
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manager: Improve style
parent
cc4671be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
slapos/manager/devperm.py
slapos/manager/devperm.py
+5
-3
No files found.
slapos/manager/devperm.py
View file @
15771b4b
...
...
@@ -9,6 +9,7 @@ from slapos.manager import interface
logger
=
logging
.
getLogger
(
__name__
)
@
implementer
(
interface
.
IManager
)
class
Manager
(
object
):
disk_device_filename
=
'.slapos-disk-permission'
...
...
@@ -22,7 +23,8 @@ class Manager(object):
if
'devperm'
in
config
[
'manager'
]:
if
'allowed-disk-for-vm'
in
config
[
'manager'
][
'devperm'
]:
self
.
allowed_disk_for_vm
=
[]
for
line
in
config
[
'manager'
][
'devperm'
][
'allowed-disk-for-vm'
].
splitlines
():
for
line
in
config
[
'manager'
][
'devperm'
][
'allowed-disk-for-vm'
].
splitlines
():
line
=
line
.
strip
()
if
line
:
self
.
allowed_disk_for_vm
.
append
(
line
)
...
...
@@ -71,7 +73,7 @@ class Manager(object):
with
open
(
disk_dev_path
)
as
f
:
try
:
disk_list
=
json
.
load
(
f
)
except
:
except
Exception
:
logger
.
warning
(
'Bad disk configuration file'
,
exc_info
=
True
)
return
...
...
@@ -112,7 +114,7 @@ class Manager(object):
continue
logger
.
warning
(
"Transfer ownership of %s to %s"
%
(
disk
,
pwd
.
getpwuid
(
uid
).
pw_name
))
os
.
chown
(
disk
,
uid
,
grp
.
getgrnam
(
"disk"
).
gr_gid
)
os
.
chown
(
disk
,
uid
,
grp
.
getgrnam
(
"disk"
).
gr_gid
)
def
report
(
self
,
partition
):
"""Method called at `slapos node report` phase.
...
...
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