Bare minimum to get NodeManager not throw exceptions
[nodemanager.git] / sliver_lxc.py
index 49ebb1c..91f1b06 100644 (file)
@@ -2,14 +2,21 @@
 
 """LXC slivers"""
 
+import accounts
+import logger
+
 class Sliver_LXC(accounts.Account):
     """This class wraps LXC commands"""
 
     SHELL = '/bin/bash'
     TYPE = 'sliver.LXC'
+    # Need to add a tag at myplc to actually use this account
+    # type = 'sliver.LXC'
 
-    def __init__(self):
-        pass
+    def __init__(self, rec):
+        print "TODO WIP __init__"
+        name=rec['name']
+        logger.verbose ('sliver_lxc: %s init'%name)
     
     @staticmethod
     def create(name, rec = None):
@@ -19,6 +26,11 @@ class Sliver_LXC(accounts.Account):
     def destroy(name):
         print "TODO destroy"
 
+    def configure(self, rec):
+        ''' Called by accounts.ensure_created -> start -> _acct.configure '''
+        print "TODO configure" 
+        name=rec['name']
+
     def start(self, delay=0):
         print "TODO start"
     
@@ -27,5 +39,6 @@ class Sliver_LXC(accounts.Account):
     
     def is_running(self):
         print "TODO is_running"
+        return True