git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
34ff591
)
renamed NovaDB to InjectContext
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Tue, 7 Feb 2012 16:46:03 +0000
(11:46 -0500)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Tue, 7 Feb 2012 16:47:31 +0000
(11:47 -0500)
sfa/openstack/nova_shell.py
patch
|
blob
|
history
diff --git
a/sfa/openstack/nova_shell.py
b/sfa/openstack/nova_shell.py
index
053fd71
..
8abbf96
100644
(file)
--- a/
sfa/openstack/nova_shell.py
+++ b/
sfa/openstack/nova_shell.py
@@
-11,25
+11,26
@@
try:
from nova.compute.manager import ComputeManager
from nova.network.manager import NetworkManager
from nova.scheduler.manager import SchedulerManager
from nova.compute.manager import ComputeManager
from nova.network.manager import NetworkManager
from nova.scheduler.manager import SchedulerManager
+ from nova.image.glance import GlanceImageService
has_nova = True
except:
has_nova = False
has_nova = True
except:
has_nova = False
-class
NovaDB
:
+class
InjectContext
:
"""
"""
- Wraps the
nova.db library
and injects the context when executing methods
+ Wraps the
module
and injects the context when executing methods
"""
"""
- def __init__(self,
db
, context):
- self.
db = db
+ def __init__(self,
proxy
, context):
+ self.
proxy = proxy
self.context = context
def __getattr__(self, name):
def func(*args, **kwds):
self.context = context
def __getattr__(self, name):
def func(*args, **kwds):
- result=getattr(self.
db
, name)(self.context, *args, **kwds)
+ result=getattr(self.
proxy
, name)(self.context, *args, **kwds)
return result
return func
return result
return func
-
+
class NovaShell:
"""
A simple xmlrpc shell to a myplc instance
class NovaShell:
"""
A simple xmlrpc shell to a myplc instance
@@
-69,7
+70,8
@@
class NovaShell:
self.compute_manager = ComputeManager()
self.network_manager = NetworkManager()
self.scheduler_manager = SchedulerManager()
self.compute_manager = ComputeManager()
self.network_manager = NetworkManager()
self.scheduler_manager = SchedulerManager()
- self.db = NovaDB(db, context.get_admin_context())
+ self.db = InjectContext(db, context.get_admin_context())
+ self.image_manager = InjectContext(GlanceImageSevice(), context.get_admin_context())
else:
self.auth = None
self.proxy = None
else:
self.auth = None
self.proxy = None