original_docstring: Check if the environment meet the precondition
docstring: Check if the environment meet the precondition
docstring_tokens: Check if the environment meet the precondition
code: def _check_precondition(self, cfg):
          """Check if the environment meet the precondition"""
  
          if "precondition" in cfg:
              precondition = cfg["precondition"]
              installer_type = precondition.get("installer_type", None)
              tc_fit_pods = precondition.get("pod_name", None)
              installer_type_env = os.environ.get('INSTALL_TYPE', None)
              pod_name_env = os.environ.get('NODE_NAME', None)
  
              LOG.info("installer_type: %s, installer_type_env: %s",
                       installer_type, installer_type_env)
              LOG.info("tc_fit_pods: %s, pod_name_env: %s",
                       tc_fit_pods, pod_name_env)
              if installer_type and installer_type_env:
                  if installer_type_env not in installer_type:
                      return False
                  return False
              if tc_fit_pods and pod_name_env:
                  if pod_name_env not in tc_fit_pods:
                      return False
          return True
code_tokens: def _check_precondition ( self , cfg ) : if "precondition" in cfg : precondition = cfg [ "precondition" ] installer_type = precondition . get ( "installer_type" , None ) tc_fit_pods = precondition . get ( "pod_name" , None ) installer_type_env = os . environ . get ( 'INSTALL_TYPE' , None ) pod_name_env = os . environ . get ( 'NODE_NAME' , None ) LOG . info ( "installer_type: %s, installer_type_env: %s" , installer_type , installer_type_env ) LOG . info ( "tc_fit_pods: %s, pod_name_env: %s" , tc_fit_pods , pod_name_env ) if installer_type and installer_type_env : if installer_type_env not in installer_type : return False return False if tc_fit_pods and pod_name_env : if pod_name_env not in tc_fit_pods : return False return True
short_docstring: Check if the environment meet the precondition
short_docstring_tokens: Check if the environment meet the precondition
comment: """Check if the environment meet the precondition"""