ashb commented on a change in pull request #9645:
URL: https://github.com/apache/airflow/pull/9645#discussion_r449639584



##########
File path: airflow/configuration.py
##########
@@ -267,17 +272,49 @@ def _get_env_var_option(self, section, key):
         env_var_cmd = env_var + '_CMD'
         if env_var_cmd in os.environ:
             # if this is a valid command key...
-            if (section, key) in self.as_command_stdout:
+            if (section, key) in self.configs_with_secret:
                 return run_command(os.environ[env_var_cmd])
 
     def _get_cmd_option(self, section, key):
         fallback_key = key + '_cmd'
         # if this is a valid command key...
-        if (section, key) in self.as_command_stdout:
+        if (section, key) in self.configs_with_secret:
             if super().has_option(section, fallback_key):
                 command = super().get(section, fallback_key)
                 return run_command(command)
 
+    @cached_property
+    def _secrets_backend_client(self):
+        if super().has_option('secrets', 'backend') is False:
+            return None
+
+        secrets_backend_cls = super().get('secrets', 'backend')
+        if not secrets_backend_cls:
+            return None
+        print("secrets_backend_cls", secrets_backend_cls)
+        secrets_backend = import_string(secrets_backend_cls)
+        if secrets_backend:
+            try:
+                alternative_secrets_config_dict = json.loads(
+                    super().get('secrets', 'backend_kwargs', fallback='{}')
+                )
+            except JSONDecodeError:

Review comment:
       ```suggestion
               except json.JSONDecodeError:
   ```
   
   Then we don't have to have two import statements.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to