Skip to content
Snippets Groups Projects
Commit b8aa46ed authored by Balazs Lecz's avatar Balazs Lecz
Browse files

LXC: Fix GetInstanceInfo()


Don't try to get cgroups info if instance is not running.

Signed-off-by: default avatarBalazs Lecz <leczb@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent c83864fe
No related branches found
No related tags found
No related merge requests found
......@@ -189,12 +189,11 @@ class LXCHypervisor(hv_base.BaseHypervisor):
# 'ganeti-lxc-test1' is STOPPED
# 'ganeti-lxc-test1' is RUNNING
_, state = result.stdout.rsplit(None, 1)
if state != "RUNNING":
return None
cpu_list = self._GetCgroupCpuList(instance_name)
if state == "RUNNING":
return (instance_name, 0, 0, len(cpu_list), 0, 0)
return None
return (instance_name, 0, 0, len(cpu_list), 0, 0)
def GetAllInstancesInfo(self):
"""Get properties of all instances.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment