mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
cgroups: Raise RuntimeError in freeze if no freezer controller
Without this patch, this will result in an error due to trying to call `.cgroup` on None. Making this a RuntimeError instaed means that a) you get a more useful error message and b) you can catch the exception without blanket `except Exception as e`.
This commit is contained in:
parent
290af6619d
commit
c89f712923
@ -448,6 +448,8 @@ class CgroupsModule(Module):
|
||||
|
||||
# Create Freezer CGroup
|
||||
freezer = self.controller('freezer')
|
||||
if freezer is None:
|
||||
raise RuntimeError('freezer cgroup controller not present')
|
||||
freezer_cg = freezer.cgroup('/DEVLIB_FREEZER')
|
||||
thawed_cg = freezer.cgroup('/')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user