From 230fe1e5ef53d3884f09b59f1c999a1046b23deb Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 24 Aug 2013 18:07:23 -0700 Subject: [PATCH] Autoload Nova extensions This patch adds logic to autoload standard novaclient extensions (e.g. baremetal) and any third-party extensions that might be installed. Thus, resource plugins that make use of installed extensions are able to use the standard OpenStackClients rather than have to a) subclass and override OpenStackClients or b) create a shadow nova client within the resource plugin with the desired extension loaded. Change-Id: Ifdcaa896babda0e1e7e10a55253a8baa37582264 --- heat/engine/clients.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/heat/engine/clients.py b/heat/engine/clients.py index 7866973f..6deae5b1 100644 --- a/heat/engine/clients.py +++ b/heat/engine/clients.py @@ -23,6 +23,7 @@ logger = logging.getLogger(__name__) from heat.common import heat_keystoneclient as hkc from novaclient import client as novaclient +from novaclient import shell as novashell try: from swiftclient import client as swiftclient except ImportError: @@ -93,12 +94,16 @@ class OpenStackClients(object): logger.error("Nova connection failed, no auth_token!") return None + computeshell = novashell.OpenStackComputeShell() + extensions = computeshell._discover_extensions("1.1") + args = { 'project_id': con.tenant, 'auth_url': con.auth_url, 'service_type': service_type, 'username': None, - 'api_key': None + 'api_key': None, + 'extensions': extensions } client = novaclient.Client(1.1, **args) -- 2.45.2