Sfoglia il codice sorgente

Always deduplicate detected certificate names

Eli Young 8 anni fa
parent
commit
027d55f6b7
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      filter_plugins/oo_filters.py

+ 1 - 1
filter_plugins/oo_filters.py

@@ -529,9 +529,9 @@ class FilterModule(object):
                 raise errors.AnsibleFilterError(("|failed to parse certificate '%s', " % certificate['certfile'] +
                 raise errors.AnsibleFilterError(("|failed to parse certificate '%s', " % certificate['certfile'] +
                                                  "please specify certificate names in host inventory"))
                                                  "please specify certificate names in host inventory"))
 
 
+            certificate['names'] = list(set(certificate['names']))
             if 'cafile' not in certificate:
             if 'cafile' not in certificate:
                 certificate['names'] = [name for name in certificate['names'] if name not in internal_hostnames]
                 certificate['names'] = [name for name in certificate['names'] if name not in internal_hostnames]
-                certificate['names'] = list(set(certificate['names']))
                 if not certificate['names']:
                 if not certificate['names']:
                     raise errors.AnsibleFilterError(("|failed to parse certificate '%s' or " % certificate['certfile'] +
                     raise errors.AnsibleFilterError(("|failed to parse certificate '%s' or " % certificate['certfile'] +
                                                      "detected a collision with internal hostname, please specify " +
                                                      "detected a collision with internal hostname, please specify " +