Browse Source

Change the order of template_var calls in check_htpasswd_provider

This would make sure correct last_checked_var would be returned
Vadim Rutkovsky 6 years ago
parent
commit
849d9188eb
1 changed files with 5 additions and 5 deletions
  1. 5 5
      roles/lib_utils/action_plugins/sanity_checks.py

+ 5 - 5
roles/lib_utils/action_plugins/sanity_checks.py

@@ -264,16 +264,16 @@ class ActionModule(ActionBase):
         kind HTPasswdPasswordIdentityProvider and
         openshift_master_manage_htpasswd is False"""
 
-        idps = self.template_var(
-            hostvars, host, 'openshift_master_identity_providers')
-        if not idps:
-            # If we don't find any identity_providers, nothing for us to do.
-            return None
         manage_pass = self.template_var(
             hostvars, host, 'openshift_master_manage_htpasswd')
         if to_bool(manage_pass):
             # If we manage the file, we can just generate in the new path.
             return None
+        idps = self.template_var(
+            hostvars, host, 'openshift_master_identity_providers')
+        if not idps:
+            # If we don't find any identity_providers, nothing for us to do.
+            return None
         old_keys = ('file', 'fileName', 'file_name', 'filename')
         for idp in idps:
             if idp['kind'] == 'HTPasswdPasswordIdentityProvider':