Remove XEN_CMD from constants, adjust to PowercycleNode
[ganeti-local] / lib / hypervisor / hv_lxc.py
index b7054f5..819df79 100644 (file)
@@ -157,17 +157,19 @@ class LXCHypervisor(hv_base.BaseHypervisor):
 
     return memory
 
-  def ListInstances(self):
+  def ListInstances(self, hvparams=None):
     """Get the list of running instances.
 
     """
     return [iinfo[0] for iinfo in self.GetAllInstancesInfo()]
 
-  def GetInstanceInfo(self, instance_name):
+  def GetInstanceInfo(self, instance_name, hvparams=None):
     """Get instance properties.
 
     @type instance_name: string
     @param instance_name: the instance name
+    @type hvparams: dict of strings
+    @param hvparams: hvparams to be used with this instance
     @rtype: tuple of strings
     @return: (name, id, memory, vcpus, stat, times)
 
@@ -189,9 +191,11 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     memory = self._GetCgroupMemoryLimit(instance_name) / (1024 ** 2)
     return (instance_name, 0, memory, len(cpu_list), 0, 0)
 
-  def GetAllInstancesInfo(self):
+  def GetAllInstancesInfo(self, hvparams=None):
     """Get properties of all instances.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor parameter
     @return: [(name, id, memory, vcpus, stat, times),...]
 
     """
@@ -393,11 +397,14 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     # Currently lxc instances don't have memory limits
     pass
 
-  def GetNodeInfo(self):
+  def GetNodeInfo(self, hvparams=None):
     """Return information about the node.
 
     This is just a wrapper over the base GetLinuxNodeInfo method.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor parameters, not used in this class
+
     @return: a dict with the following keys (values in MiB):
           - memory_total: the total memory size on the node
           - memory_free: the available memory on the node for instances
@@ -417,11 +424,14 @@ class LXCHypervisor(hv_base.BaseHypervisor):
                                    user=constants.SSH_CONSOLE_USER,
                                    command=["lxc-console", "-n", instance.name])
 
-  def Verify(self):
+  def Verify(self, hvparams=None):
     """Verify the hypervisor.
 
     For the LXC manager, it just checks the existence of the base dir.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor parameters to be verified against; not used here
+
     @return: Problem description if something is wrong, C{None} otherwise
 
     """
@@ -439,9 +449,12 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     return self._FormatVerifyResults(msgs)
 
   @classmethod
-  def PowercycleNode(cls):
+  def PowercycleNode(cls, hvparams=None):
     """LXC powercycle, just a wrapper over Linux powercycle.
 
+    @type hvparams: dict of strings
+    @param hvparams: hypervisor params to be used on this node
+
     """
     cls.LinuxPowercycle()