init accepts client argument
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Sun, 7 Apr 2013 23:32:07 +0000 (19:32 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Sun, 7 Apr 2013 23:32:07 +0000 (19:32 -0400)
plstackapi/openstack/driver.py

index e055a60..5a42d79 100644 (file)
@@ -1,14 +1,18 @@
 from plstackapi.planetstack.config import Config
-from plstackapi.openstack.shell import OpenStackShell
+from plstackapi.openstack.client import OpenStackClient
 
 class OpenStackDriver:
 
-    def __init__(self, config = None): 
+    def __init__(self, config = None, client=None): 
         if config:
             self.config = Config(config)
         else:
             self.config = Config() 
-        self.shell = OpenStackShell()
+
+        if client:
+            self.shell = client
+        else:
+            self.shell = OpenStackClient()
 
     def create_tenant(self, tenant_name, enabled, description):
         """Create keystone tenant. Suggested fields: name, description, enabled"""