From d14d9202e3a0d7ce4547d69a6857c8b9f1874a65 Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Tue, 12 Sep 2017 13:17:04 +0200 Subject: [PATCH] Avoid cloudwatch endpoint retrieve when disabled If openstack-api-cloudwatch service is disabled in a deployment these lines of code will provoke a traceback when trying to get the cloudwatch end-point. Change-Id: I7257f79af764cddc16423826143b0d8babfe54e7 Partial-Bug: #1715083 --- heat/engine/clients/os/nova.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/heat/engine/clients/os/nova.py b/heat/engine/clients/os/nova.py index eb9c030b1b..1326dac3a9 100644 --- a/heat/engine/clients/os/nova.py +++ b/heat/engine/clients/os/nova.py @@ -393,14 +393,15 @@ echo -e '%s\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers attachments.append((jsonutils.dumps(metadata), 'cfn-init-data', 'x-cfninitdata')) - heat_client_plugin = self.context.clients.client_plugin('heat') - watch_url = cfg.CONF.heat_watch_server_url - if not watch_url: - watch_url = heat_client_plugin.get_watch_server_url() - - attachments.append((watch_url, 'cfn-watch-server', 'x-cfninitdata')) - if is_cfntools: + heat_client_plugin = self.context.clients.client_plugin('heat') + watch_url = cfg.CONF.heat_watch_server_url + if not watch_url: + watch_url = heat_client_plugin.get_watch_server_url() + + attachments.append((watch_url, + 'cfn-watch-server', 'x-cfninitdata')) + cfn_md_url = heat_client_plugin.get_cfn_metadata_server_url() attachments.append((cfn_md_url, 'cfn-metadata-server', 'x-cfninitdata'))