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
17
Merge Requests
17
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
515d3366
Commit
515d3366
authored
Jun 08, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[format] Add more logging information
parent
14dc7d72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
slapos/format.py
slapos/format.py
+8
-3
No files found.
slapos/format.py
View file @
515d3366
...
@@ -290,10 +290,14 @@ class CGroupManager(Manager):
...
@@ -290,10 +290,14 @@ class CGroupManager(Manager):
def
update
(
self
):
def
update
(
self
):
"""Control runtime state of the computer."""
"""Control runtime state of the computer."""
if
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
cpuset_path
,
"cpu0"
)):
cpu0_path
=
os
.
path
.
join
(
self
.
cpuset_path
,
"cpu0"
)
if
os
.
path
.
exists
(
cpu0_path
):
# proceed only whe CPUSETs were formatted by this manager
# proceed only whe CPUSETs were formatted by this manager
self
.
prepare_cpu_space
()
self
.
prepare_cpu_space
()
self
.
ensure_exlusive_cpu
()
self
.
ensure_exlusive_cpu
()
else
:
logger
.
warning
(
"Computer was not formatted by {} because {} doesn't exist!"
.
format
(
self
.
__class__
.
__name__
,
cpu0_path
))
def
prepare_cpuset
(
self
):
def
prepare_cpuset
(
self
):
"""Create cgroup folder per-CPU with exclusive access to the CPU.
"""Create cgroup folder per-CPU with exclusive access to the CPU.
...
@@ -504,6 +508,7 @@ class Computer(object):
...
@@ -504,6 +508,7 @@ class Computer(object):
def
update
(
self
):
def
update
(
self
):
"""Update computer runtime info and state."""
"""Update computer runtime info and state."""
for
manager
in
self
.
_manager_list
:
for
manager
in
self
.
_manager_list
:
logger
.
info
(
"Updating computer with "
+
manager
.
__class__
.
__name__
)
manager
.
update
()
manager
.
update
()
# Collect environmental hardware/network information.
# Collect environmental hardware/network information.
...
@@ -740,7 +745,7 @@ class Computer(object):
...
@@ -740,7 +745,7 @@ class Computer(object):
# Iterate over all managers and let them `format` the computer too
# Iterate over all managers and let them `format` the computer too
for
manager
in
self
.
_manager_list
:
for
manager
in
self
.
_manager_list
:
logger
.
info
(
"Formatting with "
+
manager
.
__class__
.
__name__
)
logger
.
info
(
"Formatting
computer
with "
+
manager
.
__class__
.
__name__
)
manager
.
format
()
manager
.
format
()
# get list of instance external storage if exist
# get list of instance external storage if exist
...
@@ -916,7 +921,7 @@ class Partition(object):
...
@@ -916,7 +921,7 @@ class Partition(object):
def
dump
(
self
):
def
dump
(
self
):
"""Dump available resources into ~partition_home/.slapos-resource."""
"""Dump available resources into ~partition_home/.slapos-resource."""
file_path
=
os
.
path
.
join
(
self
.
path
,
self
.
resource_file
)
file_path
=
os
.
path
.
join
(
self
.
path
,
self
.
resource_file
)
logger
.
info
(
"Partition
{} dumping resources
to {}"
.
format
(
logger
.
info
(
"Partition
resources saved
to {}"
.
format
(
self
.
reference
,
file_path
))
self
.
reference
,
file_path
))
data
=
_getDict
(
self
)
data
=
_getDict
(
self
)
with
open
(
file_path
,
"wb"
)
as
fo
:
with
open
(
file_path
,
"wb"
)
as
fo
:
...
...
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