From ea84ea95d9d3ed8de232e41adf97073905255ee0 Mon Sep 17 00:00:00 2001 From: Xavi Leon Date: Wed, 21 Dec 2011 11:52:40 -0500 Subject: [PATCH] Removed some references to sliver_vs which crashed nodemanager. Changed the default slice type from sliver.VS to sliver.LXC so we don't need to specify it on myplc --- api.py | 1 - api_calls.py | 7 ++++--- sliver_lxc.py | 4 ++-- slivermanager.py | 11 +++++------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/api.py b/api.py index ca58e19..2f94d23 100644 --- 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 * diff --git a/api_calls.py b/api_calls.py index 66d8833..4a5558e 100644 --- a/api_calls.py +++ b/api_calls.py @@ -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=[], diff --git a/sliver_lxc.py b/sliver_lxc.py index 1b64f34..b1dc99f 100644 --- a/sliver_lxc.py +++ b/sliver_lxc.py @@ -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) diff --git a/slivermanager.py b/slivermanager.py index 3e4fb1f..739b5c0 100644 --- a/slivermanager.py +++ b/slivermanager.py @@ -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() -- 2.43.0