summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramishra <ramishra@redhat.com>2021-02-03 09:42:20 +0530
committerBrendan Shephard <bshephar@redhat.com>2021-10-10 22:02:23 +0000
commit9b24c17308007ae7fe78f4b99acadc6b96eb5dba (patch)
treebda8f742f6051e5826d8575a1819bb18850b37ca
parentb8a134fcac85016c3875fe4cef04c9c01af647e1 (diff)
downloadheat-9b24c17308007ae7fe78f4b99acadc6b96eb5dba.tar.gz
Don't create deployment when changing transport
Earlier when changing software config transport we used to create a dummy deployment to push the metadata. However this would not work with convergence as we take resource lock for the update which updates the config transport (another engine would try to update the resource metadata for deployment when one engine has locked it). Currently it works when updating transport as we ignore the error in creating dummy deployment, but if there are any new depoyments for the server they would fail. We don't need to push the metadata as it would be pushed when the there is a new/updated deployment. Few additional changes in the patch: - We don't need to ignore the error as servers are now not replaced if the resource is in ERROR when nova server is good/ACTIVE. - Delete the existing tempurls and zaqar queues when changing transport. Task: 41744 Change-Id: Id592b29df36320d8697bd370252ada02612ba7d0 (cherry picked from commit 79fb6509a9c6ac5438d00d1eb858a4f5b014e6e3)
-rw-r--r--heat/engine/resources/server_base.py31
1 files changed, 9 insertions, 22 deletions
diff --git a/heat/engine/resources/server_base.py b/heat/engine/resources/server_base.py
index ce12693a0..b5daa3615 100644
--- a/heat/engine/resources/server_base.py
+++ b/heat/engine/resources/server_base.py
@@ -241,29 +241,14 @@ class BaseServer(stack_user.StackUser):
if not self.user_data_software_config():
return
try:
- metadata = self.metadata_get(True) or {}
- self._create_transport_credentials(prop_diff)
- self._populate_deployments_metadata(metadata, prop_diff)
- # push new metadata to all sources by creating a dummy
- # deployment
- sc = self.rpc_client().create_software_config(
- self.context, 'ignored', 'ignored', '')
- sd = self.rpc_client().create_software_deployment(
- self.context, self.resource_id, sc['id'])
- self.rpc_client().delete_software_deployment(
- self.context, sd['id'])
- self.rpc_client().delete_software_config(
- self.context, sc['id'])
+ self._delete_queue()
+ self._delete_temp_url()
except Exception:
- # Updating the software config transport is on a best-effort
- # basis as any raised exception here would result in the resource
- # going into an ERROR state, which will be replaced on the next
- # stack update. This is not desirable for a server. The old
- # transport will continue to work, and the new transport may work
- # despite exceptions in the above block.
- LOG.exception(
- 'Error while updating software config transport'
- )
+ pass
+
+ metadata = self.metadata_get(True) or {}
+ self._create_transport_credentials(prop_diff)
+ self._populate_deployments_metadata(metadata, prop_diff)
def metadata_update(self, new_metadata=None):
"""Refresh the metadata if new_metadata is None."""
@@ -300,6 +285,8 @@ class BaseServer(stack_user.StackUser):
headers = swift.head_container(container)
if int(headers['x-container-object-count']) == 0:
swift.delete_container(container)
+ self.data_delete('metadata_object_name')
+ self.data_delete('metadata_put_url')
def _delete_queue(self):
queue_id = self.data().get('metadata_queue_id')