Yuvipanda has submitted this change and it was merged.

Change subject: shinken: Make sure hosts are unique
......................................................................


shinken: Make sure hosts are unique

Temporary fix for T96817

Bug: T96817
Change-Id: Icc8d0b16922c2fceeaf0aa8d77cc03f1b1dcb8ef
---
M modules/shinken/files/shinkengen
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/modules/shinken/files/shinkengen b/modules/shinken/files/shinkengen
index 8021746..c673069 100755
--- a/modules/shinken/files/shinkengen
+++ b/modules/shinken/files/shinkengen
@@ -89,6 +89,7 @@
                          ldap3.SEARCH_SCOPE_WHOLE_SUBTREE,
                          attributes=ldap3.ALL_ATTRIBUTES)
         hosts = []
+        hostnames = set()  # Temp fix for T96817
         for responseitem in self.conn.response:
             hostinfo = responseitem['attributes']
             ip = [a for a in hostinfo['aRecord'] if a.startswith('10.')][0]
@@ -96,6 +97,10 @@
                 var[0]: var[1]
                 for var in [pv.split("=") for pv in hostinfo['puppetVar']]
             }
+            if puppetvars['instancename'] in hostnames:
+                continue
+            else:
+                hostnames.add(puppetvars['instancename'])
             hosts.append({
                 'ec2id': hostinfo['dc'][0],
                 'ip': ip,

-- 
To view, visit https://gerrit.wikimedia.org/r/205817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc8d0b16922c2fceeaf0aa8d77cc03f1b1dcb8ef
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to