Commit 0628a50a authored by Iustin Pop's avatar Iustin Pop
Browse files

Make LXC fail verification if cgroup is not mounted



Since LXC now relies on cgroup memory limits to enforce memory, let's
make hypervisor verification (and thus cluster-verify) return errors
when the cgroup filesystem is not mounted.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 53fde1ac
#
#
# Copyright (C) 2010 Google Inc.
# Copyright (C) 2010, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -425,10 +425,18 @@ class LXCHypervisor(hv_base.BaseHypervisor):
@return: Problem description if something is wrong, C{None} otherwise
"""
if os.path.exists(self._ROOT_DIR):
return None
else:
return "The required directory '%s' does not exist" % self._ROOT_DIR
msgs = []
if not os.path.exists(self._ROOT_DIR):
msgs.append("The required directory '%s' does not exist" %
self._ROOT_DIR)
try:
self._GetCgroupMountPoint()
except errors.HypervisorError, err:
msgs.append(str(err))
return self._FormatVerifyResults(msgs)
@classmethod
def PowercycleNode(cls):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment