From 21c7651fe55d3737383de673d564b472da75e788 Mon Sep 17 00:00:00 2001 From: Stanislaw Bogatkin Date: Tue, 4 Apr 2017 15:05:46 +0300 Subject: [PATCH] Use intersection of added vs deleted nodes instead of just deleted ones There are cases when nailgun can send us data where there are nodes included into list of added nodes and deleted ones. As a result, puppet manifests failed with resource ensurance for present and absent hosts. To avoid this situation, subtract added nodes from deleted prior to actually deleting them from hosts. Change-Id: I515f7fae4bbe67123d70572a4f861e879ec580f6 Closes-Bug: #1679522 --- deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp b/deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp index 03d304cc52..b38ee14eb3 100644 --- a/deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp +++ b/deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp @@ -8,7 +8,7 @@ class osnailyfacter::hosts::hosts { $host_resources = network_metadata_to_hosts($network_metadata) $messaging_host_resources = network_metadata_to_hosts($network_metadata, 'mgmt/messaging', $messaging_prefix) - $deleted_nodes = hiera('deleted_nodes', []) + $deleted_nodes = difference(hiera('deleted_nodes', []), keys($host_resources)) $deleted_messaging_nodes = prefix($deleted_nodes, $messaging_prefix) Host {