From: Tony Mack Date: Sun, 7 Apr 2013 23:32:07 +0000 (-0400) Subject: init accepts client argument X-Git-Tag: 1.0~263 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ad8b093f25e8cb9387d44907f20699b52c03b1c2;p=plstackapi.git init accepts client argument --- diff --git a/plstackapi/openstack/driver.py b/plstackapi/openstack/driver.py index e055a60..5a42d79 100644 --- a/plstackapi/openstack/driver.py +++ b/plstackapi/openstack/driver.py @@ -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"""