# Facility to use. If unset defaults to LOG_USER.
# syslog_log_facility = LOG_LOCAL0
+# The namespace for the custom backend. Must provide class Clients which will be
+# imported. Defaults to OpenStack if none provided.
+# cloud_backend=deltacloud_heat.client
+
sql_connection = mysql://heat:heat@localhost/heat
db_backend=heat.db.sqlalchemy.api
# License for the specific language governing permissions and limitations
# under the License.
+from heat.openstack.common import cfg
+from heat.openstack.common import importutils
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)
logger.info('quantumclient not available')
-class Clients(object):
+cloud_opts = [
+ cfg.StrOpt('cloud_backend',
+ default=None,
+ help="Cloud module to use as a backend. Defaults to OpenStack.")
+]
+cfg.CONF.register_opts(cloud_opts)
+
+
+class OpenStackClients(object):
'''
Convenience class to create and cache client instances.
'''
self._quantum = quantumclient.Client(**args)
return self._quantum
+
+
+if cfg.CONF.cloud_backend:
+ cloud_backend_module = importutils.import_module(cfg.CONF.cloud_backend)
+ Clients = cloud_backend_module.Clients
+else:
+ Clients = OpenStackClients
+
+logger.debug('Using backend %s' % Clients)