From: Tony Mack Date: Fri, 29 Jun 2012 15:39:43 +0000 (-0400) Subject: renaming X-Git-Tag: sfa-2.1-12~33 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ee90ec5ec1910195fdb634f57df99a4af422c6f2;p=sfa.git renaming --- diff --git a/sfa/openstack/shell.py b/sfa/openstack/shell.py new file mode 100644 index 00000000..7fab67f8 --- /dev/null +++ b/sfa/openstack/shell.py @@ -0,0 +1,39 @@ +import sys +import xmlrpclib +import socket +import gettext +from urlparse import urlparse +from sfa.util.sfalogging import logger +from sfa.util.config import Config + +try: + from sfa.openstack.client import GlanceClient, NovaClient, KeystoneClient + has_nova = True +except: + has_nova = False + + + +class Shell: + """ + A simple native shell to a nova backend. + This class can receive all nova calls to the underlying testbed + """ + + # dont care about limiting calls yet + direct_calls = [] + alias_calls = {} + + + # use the 'capability' auth mechanism for higher performance when the PLC db is local + def __init__ ( self, config=None) : + if not config: + config = Config() + if has_nova: + # instantiate managers + self.auth_manager = KeystoneClient(config) + self.image_manager = GlanceClient(config) + self.nova_manager = NovaClient(config) + else: + logger.debug('nova access - REST') + raise SfaNotImplemented('nova access - Rest')