Removed some references to sliver_vs which crashed nodemanager. Changed the
authorXavi Leon <xleon@ac.upc.edu>
Wed, 21 Dec 2011 16:52:40 +0000 (11:52 -0500)
committerXavi Leon <xleon@ac.upc.edu>
Wed, 21 Dec 2011 16:52:40 +0000 (11:52 -0500)
default slice type from sliver.VS to sliver.LXC so we don't need to specify it
on myplc

api.py
api_calls.py
sliver_lxc.py
slivermanager.py

diff --git a/api.py b/api.py
index ca58e19..2f94d23 100644 (file)
--- a/api.py
+++ b/api.py
@@ -22,7 +22,6 @@ import sys
 
 import accounts
 import database
-import sliver_vs
 import ticket
 import tools
 from api_calls import *
index 66d8833..4a5558e 100644 (file)
@@ -18,6 +18,7 @@ import socket
 import struct
 import threading
 import xmlrpclib
+import sliver_lxc
 
 try:
     from PLC.Parameter import Parameter, Mixed
@@ -35,8 +36,8 @@ import logger
 # A better approach will involve more extensive code splitting, I think.
 try: import database
 except: import logger as database
-try: import sliver_vs
-except: import logger as sliver_vs
+#try: import sliver_vs
+#except: import logger as sliver_vs
 import ticket as ticket_module
 import tools
 
@@ -147,7 +148,7 @@ def AdminTicket(ticket):
 @export_to_api(0)
 def GetXIDs():
     """Return an dictionary mapping Slice names to XIDs"""
-    return dict([(pwent[0], pwent[2]) for pwent in pwd.getpwall() if pwent[6] == sliver_vs.Sliver_VS.SHELL])
+    return dict([(pwent[0], pwent[2]) for pwent in pwd.getpwall() if pwent[6] == sliver_lxc.Sliver_LXC.SHELL])
 
 @export_to_docbook(roles=['self'],
                    accepts=[],
index 1b64f34..b1dc99f 100644 (file)
@@ -37,8 +37,8 @@ class Sliver_LXC(lv.Sliver_Libvirt):
         # arch x86_64
         vref = rec['vref']
         if vref is None:
-            logger.log('sliver_libvirt: %s: WARNING - no vref attached defaults to lxc-debian' % (name))
-            vref = "lxc-squeeze-x86_64"
+            logger.log('sliver_libvirt: %s: WARNING - no vref attached defaults to lxc-f14' % (name))
+            vref = "lxc-f14-x86_64"
 
         refImgDir    = os.path.join(Sliver_LXC.REF_IMG_BASE_DIR, vref)
         containerDir = os.path.join(Sliver_LXC.CON_BASE_DIR, name)
index 3e4fb1f..739b5c0 100644 (file)
@@ -16,7 +16,6 @@ import api, api_calls
 import database
 import accounts
 import controller
-import sliver_vs
 import sliver_lxc
 
 try: from bwlimit import bwmin, bwmax
@@ -159,7 +158,7 @@ def GetSlivers(data, config = None, plc=None, fullupdate=True):
         if rec['instantiation'].lower() == 'nm-controller':
             rec.setdefault('type', attributes.get('type', 'controller.Controller'))
         else:
-            rec.setdefault('type', attributes.get('type', 'sliver.VServer'))
+            rec.setdefault('type', attributes.get('type', 'sliver.LXC'))
 
         # set the vserver reference.  If none, set to default.
         rec.setdefault('vref', attributes.get('vref', 'default'))
@@ -206,11 +205,11 @@ def deliver_ticket(data):
     return GetSlivers(data, fullupdate=False)
 
 def start():
-    for resname, default_amount in sliver_vs.DEFAULT_ALLOCATION.iteritems():
-        DEFAULT_ALLOCATION[resname]=default_amount
+    # No default allocation values for LXC yet, think if its necessary given
+    # that they are also default allocation values in this module
+    #for resname, default_amount in sliver_vs.DEFAULT_ALLOCATION.iteritems():
+    #    DEFAULT_ALLOCATION[resname]=default_amount
 
-    #accounts.register_class(sliver_vs.Sliver_VS)
-    #accounts.register_class(sliver_libvirt.Sliver_LV)
     accounts.register_class(sliver_lxc.Sliver_LXC)
     accounts.register_class(controller.Controller)
     database.start()